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

Improve SyntaxTree / C / math expression parser #3

Closed
translunar opened this issue Apr 11, 2012 · 2 comments
Closed

Improve SyntaxTree / C / math expression parser #3

translunar opened this issue Apr 11, 2012 · 2 comments
Assignees

Comments

@translunar
Copy link
Member

SyntaxTree (ext/nmatrix/generator/syntax_tree.rb) supports only very simple mathematical expressions. I'd like it if it could handle more complicated stuff.

That probably means finding a library with few or no dependencies which can parse C. It's possible you could derive your own from SyntaxTree, though this doesn't really even support parentheses.

It'd also be nice if it understood things like absolute value functions -- or really anything else you might find in NETLIB's BLAS subroutines.

@translunar
Copy link
Member Author

I've found a really great C AST parser, called -- fittingly -- CAST.

gem install cast19 # Ruby 1.9 version

I'm playing around with it as I write this.

@translunar
Copy link
Member Author

I wrote this, but @chriswailes recommends using C++ templates embedded in extern "C" {} blocks.

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

No branches or pull requests

1 participant