Greetings,
I have to write the following parser
{ (A) OR (B) OR (C) } {{ (E) AND (F) } OR { (E) OR (C) }}
Here each alphabet internally represents an integer. I am new to
parsing and do not have much idea. What would be the best approach to
this? Any pointers would be very helpful.
Thanks very much,
Koolrans 5 1470
Koolrans wrote: Greetings,
I have to write the following parser
{ (A) OR (B) OR (C) } {{ (E) AND (F) } OR { (E) OR (C) }}
Here each alphabet internally represents an integer. I am new to parsing and do not have much idea. What would be the best approach to this? Any pointers would be very helpful.
Chapter 6 in Stroustrup, if memory serves me, "Expressions", contains
a full example of an expression parser. Or you could get a book on
Lex and Yacc and use them.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Victor Bazarov wrote: Koolrans wrote: Greetings,
I have to write the following parser
{ (A) OR (B) OR (C) } {{ (E) AND (F) } OR { (E) OR (C) }}
Here each alphabet internally represents an integer. I am new to parsing and do not have much idea. What would be the best approach to this? Any pointers would be very helpful.
Chapter 6 in Stroustrup, if memory serves me, "Expressions", contains a full example of an expression parser. Or you could get a book on Lex and Yacc and use them.
spirit being an alternative to lex and yacc.
Noah Roberts wrote: Victor Bazarov wrote: Koolrans wrote: Greetings,
I have to write the following parser
{ (A) OR (B) OR (C) } {{ (E) AND (F) } OR { (E) OR (C) }}
Here each alphabet internally represents an integer. I am new to parsing and do not have much idea. What would be the best approach to this? Any pointers would be very helpful.
Chapter 6 in Stroustrup, if memory serves me, "Expressions", contains a full example of an expression parser. Or you could get a book on Lex and Yacc and use them.
spirit being an alternative to lex and yacc.
Thanks you. That was helpful.
Victor Bazarov wrote: Koolrans wrote: Greetings,
I have to write the following parser
{ (A) OR (B) OR (C) } {{ (E) AND (F) } OR { (E) OR (C) }}
Here each alphabet internally represents an integer. I am new to parsing and do not have much idea. What would be the best approach to this? Any pointers would be very helpful.
Chapter 6 in Stroustrup, if memory serves me, "Expressions", contains a full example of an expression parser. Or you could get a book on Lex and Yacc and use them.
V
Thanks for the input. I looked into that but looks like it is too heavy
for my purpose. Will definitely go over it in future if my need
increases.
Koolrans
Victor Bazarov wrote: Koolrans wrote: Greetings,
I have to write the following parser
{ (A) OR (B) OR (C) } {{ (E) AND (F) } OR { (E) OR (C) }}
Here each alphabet internally represents an integer. I am new to parsing and do not have much idea. What would be the best approach to this? Any pointers would be very helpful.
Chapter 6 in Stroustrup, if memory serves me, "Expressions", contains a full example of an expression parser. Or you could get a book on Lex and Yacc and use them.
Sorry, I meant Lex and Yacc were heavy for purpose. I was able to get
the examples for the book mentioned by you. They are very helpful.
koolrans This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: marktm |
last post by:
Hi-
I am using the following code and want to retrieve an attributes value.
I want to loop through the xml file and add the attribute values to an
array. The line in question is marked with...
|
by: marktm |
last post by:
Hi-
I am using the following code and want to retrieve an attributes value.
I want to loop through the xml file and add the attribute values to an
array. The line in question is marked with...
|
by: kpp9c |
last post by:
I am kind of in a bit of a jam (okay a big jam) and i was hoping that
someone here could give me a quick hand. I had a few pages of time
calculations to do. So, i just started in on them typing...
|
by: Xamalaek |
last post by:
Hello,
I need some help with the DOM TreeWalker API.
I modified the Xerces DOMPrint sample because I wanted to play around
with the DOMTreeWalker API to iterate through the sample.xml file.
...
|
by: wukexin |
last post by:
Help me, good men. I find mang books that introduce bit "mang header
files",they talk too bit,in fact it is my too fool, I don't learn it, I have
do a test program, but I have no correct doing...
|
by: ralphNOSPAM |
last post by:
Is there a function or otherwise some way to pull out the target text
within an XML tag?
For example, in the XML tag below, I want to pull out 'CALIFORNIA'.
...
|
by: gheissenberger |
last post by:
HELP!
Guy who was here before me wrote a script to parse files in Python.
Includes line:
print u
where u is a line from a file we are parsing.
However, we have started recieving data from...
|
by: ashishbathini |
last post by:
Guys I need your help ....
In this code I have to change the value of the frequency ...
the code takes the values of frequency and bit rate as inputs but i have to enter the value of freq manually...
|
by: hellt |
last post by:
today i've decided to use optionparser instead of GetOpt
and unfortunately i've got an error which i cant handle
my pice of code:
from optparse import OptionParser
def main():
usage =...
|
by: Bartc |
last post by:
"vaib" <vaibhavpanghal@gmail.comwrote in message
news:26a44cc5-0f08-41fe-859b-0d27daf3ca1d@f24g2000prh.googlegroups.com...
I don't know the formal approach to these things but I haven't come...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |