Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing expression.cc example? #34

Closed
skyrich62 opened this issue Nov 23, 2016 · 2 comments
Closed

missing expression.cc example? #34

skyrich62 opened this issue Nov 23, 2016 · 2 comments
Assignees
Labels

Comments

@skyrich62
Copy link

Hi,

First, wow! Kudos to you, this is very cool.

Your documentation says that there should be examples/expression.cc which is the same as the calculator example, but builds an parse tree and operates on that. I'm either incredibly blind, or it's not in the examples directory.

I'd really like to see a good example of how to build a parse tree with this parser.

@ColinH ColinH self-assigned this Nov 24, 2016
@ColinH
Copy link
Member

ColinH commented Nov 24, 2016

The file actually exists, unfortunately I can't remember why it was taken out of the examples directory. Take a look, see whether it works, report back, and if it does work we might put it back. It doesn't seem to be the most readable example in the world, which could be the reason we got rid of it :-)

expression.txt

@ColinH ColinH closed this as completed Nov 24, 2016
@ColinH
Copy link
Member

ColinH commented Nov 24, 2016

We just discussed this issue, the expression example was removed because, as you can see, it is not particularly readable and doesn't show how to build an AST in a nice way - it was more an experiment in how to handle the operators.

For now, I will remove the reference to it in the documentation; we already have "make a nice AST example" on our TODO list and will hopefully get around to doing this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants