473,395 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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!

--

Jul 22 '05 #1
3 1066
news.tkdsoftware.com wrote:
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.
Jul 22 '05 #2

"news.tkdsoftware.com" <ch***@noreply.nospam.tkdsoftware.com> wrote in
message news:wc****************************@tkdsoftware.co m...
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
Jul 22 '05 #3
news.tkdsoftware.com wrote:
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

Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andy | last post by:
First of all, can I reassure you that this posting is NOT spam and not market research. Please feel free to email me at the address below to check/validate this message prior to doing the survey if...
39
by: Steven T. Hatton | last post by:
I came across this while looking for information on C++ and CORBA: http://www.zeroc.com/ice.html. It got me to wondering why I need two different languages in order to write distributed computing...
0
by: Andy | last post by:
First of all, can I reassure you that this posting is NOT spam and not market research. Please feel free to email me at the address below to check/validate this message prior to doing the survey if...
42
by: John Smith | last post by:
In a C program I need to do exponentiation where the base is negative and the exponent is a fraction. In standard C this would be something like t = pow(-11.5, .333), but with this combination of...
0
by: natty2006 | last post by:
Submission Deadline extended: 13 November 2006 ************************************************************* IADIS INTERNATIONAL CONFERENCE APPLIED COMPUTING 2007 February 17-20, 2007 -...
13
by: Xah Lee | last post by:
Today, a motherfucker Christophe Rhodes (aka Xof in irc://chat.freenode.net/lisp ) kicked banned me. Here's the few relevant excerpt. (full, unedited excerpt will be published if there is a public...
14
by: Aaron Watters | last post by:
So, in between skiing runs I noticed a Business Week cover story on "cloud computing". The article had lots of interesting information in it like about how somebody's mom used to be an airline...
0
by: knorth | last post by:
The DataServices World conference offers a program for those interested in technology for data integration and data access, with emphasis on service-oriented architecture (SOA), web-oriented...
3
by: Ty Oft | last post by:
Hello Bytes! Maybe my question seems a bit silly (as one could simply answer it "Well, what are you more passionate about?" or stuff like that - please don't answer like this), but I am in a bit...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
marktang
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,...
0
Oralloy
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,...
0
jinu1996
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.