| View previous topic :: View next topic |
| Author |
Message |
news.tkdsoftware.com Guest
|
Posted: Fri Sep 24, 2004 4:42 pm Post subject: Computing AST |
|
|
Could someone show me a simple class structure example on how I'd approach
modeling my AST classes if my grammar was to parse a simple multiple
statement program which accepted statements in this format:
PRINT arithmetic_expression
So I could write a program that has:
PRINT 2+3*5
PRINT 6/3+2
Thanks in advance!
--
|
|
| Back to top |
|
 |
red floyd Guest
|
Posted: Fri Sep 24, 2004 5:28 pm Post subject: Re: Computing AST |
|
|
news.tkdsoftware.com wrote:
| Quote: | Could someone show me a simple class structure example on how I'd approach
modeling my AST classes if my grammar was to parse a simple multiple
statement program which accepted statements in this format:
PRINT arithmetic_expression
So I could write a program that has:
PRINT 2+3*5
PRINT 6/3+2
Thanks in advance!
|
You might tell your instructor that you're having problems with the
homework assignment and ask him for help.
|
|
| Back to top |
|
 |
John Harrison Guest
|
Posted: Fri Sep 24, 2004 6:09 pm Post subject: Re: Computing AST |
|
|
"news.tkdsoftware.com" <chris (AT) noreply (DOT) nospam.tkdsoftware.com> wrote in
message news:wcNNTP.01c4a255.8a46c470.999.0 (AT) tkdsoftware (DOT) com...
| Quote: | Could someone show me a simple class structure example on how I'd approach
modeling my AST classes if my grammar was to parse a simple multiple
statement program which accepted statements in this format:
PRINT arithmetic_expression
So I could write a program that has:
PRINT 2+3*5
PRINT 6/3+2
Thanks in advance!
|
See my reply to your last post.
john
|
|
| Back to top |
|
 |
Thomas Matthews Guest
|
Posted: Mon Sep 27, 2004 3:29 pm Post subject: Re: Computing AST |
|
|
news.tkdsoftware.com wrote:
| Quote: | Could someone show me a simple class structure example on how I'd approach
modeling my AST classes if my grammar was to parse a simple multiple
statement program which accepted statements in this format:
PRINT arithmetic_expression
So I could write a program that has:
PRINT 2+3*5
PRINT 6/3+2
Thanks in advance!
|
Please, please, don't use abbreviations.
What is your definition of an AST class?
A BLT could be a sandwich, a tree or a transformation.
For better communications, please define your abbreviations
before you use them or refrain from using them.
I suggest you discuss generic programming topics
in news:comp.programming.
--
Thomas Matthews
C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
|
|
| Back to top |
|
 |
|