Computing AST

  • Thread starter news.tkdsoftware.com
  • Start date
N

news.tkdsoftware.com

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!

--
 
R

red floyd

news.tkdsoftware.com said:
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.
 
J

John Harrison

news.tkdsoftware.com said:
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
 
T

Thomas Matthews

news.tkdsoftware.com said:
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
--
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top