By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,638 Members | 2,241 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,638 IT Pros & Developers. It's quick & easy.

Help with Parser

P: n/a
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

Apr 11 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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
Apr 11 '06 #2

P: n/a

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.

Apr 11 '06 #3

P: n/a
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.

Apr 12 '06 #4

P: n/a

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

Apr 12 '06 #5

P: n/a

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

Apr 12 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.