Computing AST

Discussion in 'C++' started by news.tkdsoftware.com, Sep 24, 2004.

  1. 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!

    --
     
    news.tkdsoftware.com, Sep 24, 2004
    #1
    1. Advertising

  2. news.tkdsoftware.com

    red floyd Guest

    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.
     
    red floyd, Sep 24, 2004
    #2
    1. Advertising

  3. "news.tkdsoftware.com" <> wrote in
    message news:...
    > 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
     
    John Harrison, Sep 24, 2004
    #3
  4. 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
     
    Thomas Matthews, Sep 27, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arno Seitinger

    cookies between ast and asp.net

    Arno Seitinger, Oct 28, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    494
    Saravana
    Oct 28, 2004
  2. hlwangz
    Replies:
    0
    Views:
    372
    hlwangz
    Apr 26, 2006
  3. hlwangz

    for-statement in AST

    hlwangz, Apr 26, 2006, in forum: Java
    Replies:
    1
    Views:
    363
    Oliver Wong
    Apr 26, 2006
  4. optical supercomputing

    Optical Computing: special issue - Natural Computing, Springer

    optical supercomputing, Dec 19, 2008, in forum: C Programming
    Replies:
    0
    Views:
    432
    optical supercomputing
    Dec 19, 2008
  5. optical supercomputing

    Optical Computing: special issue - Natural Computing, Springer

    optical supercomputing, Jan 16, 2009, in forum: C Programming
    Replies:
    0
    Views:
    457
    optical supercomputing
    Jan 16, 2009
Loading...

Share This Page