I'm looking for a syntax reference to ANTLR3 and a quick search didn't find one, can someone tell me where one exists?
Do you mean a list of ANTLR's reserved words? If so, have a look at this previous question:
Is there a list of reserved words in ANTLR grammars?
I encounter same issue as you.
Finally found antlr v3 syntax from here:
ANTLR Meta-Language
All the ALNLR3 documentation is here: http://www.antlr.org/wiki/display/ANTLR3/ANTLR+v3+documentation
I'm not sure exactly what you mean by syntax reference, but the guide to writing grammars is here:
http://www.antlr.org/wiki/display/ANTLR3/Grammars
Related
I don't really understand the arguments and usage of define-syntax within Scheme. For what it's worth, I'm using Petite Chez Cheme. I've looked at a few sources:
define-syntax issue in scheme
Scheme Macro for nesting expressions
http://docs.racket-lang.org/guide/pattern-macros.html
However, they haven't given me the understanding I'm looking for. I'm looking for an explicit explanation of what's happening when the new syntax is applied. I'm particularly curious about the use of ellipses ("...") when the syntax is defined.
I managed to find a detailed document about patterns and define-syntax through a little bit more search. If anybody else is curious, here is the link:
http://www.cs.uml.edu/~giam/91.531/Textbooks/RKDybvig.pdf
I searched plenty of sources but havent found anything yet.
I'm trying to create an AST (in Java) for a input file written in C. I found ANTLR and it works with the "official" C-Grammar from the ANTLR examples. Nevertheless, I read about editing grammar for the syntax-tree with e.g. "^" to mark roots etc.
When I set the output at the C.g to output=AST an empty graph is printed (some dot gibberish). Also I can't find any of that mentioned tree symbols in the grammar.
So I need to asume, that grammar doesn't support AST-generation.
Is there any working C grammar that has syntax for a AST in it? I need to find a solution in a proper time, and I wanted to check all available ressources bevor starting to edit the given grammar (what I guess will be an awful lot of work).
Thanks for you time,
Simon
I have no idea how to build S-exp.
I want to do it, because I need to build AST for my langauge.
At the beginning I used RubyParser to parse it to sexp then code gen.
But it must be ruby's subset I think.I cant define the language what I want.
Now I need to implement parser for my language.
So anyone could recommend any ruby tool that building AST for S-expression ?
Thanks!
It is not very clear from your question what exactly do you need, but simple Google search gives some interesting links to check. Maybe after checking these links, if they are not the answer to your question, you can edit question and make it more precise and concrete.
http://thingsaaronmade.com/blog/writing-an-s-expression-parser-in-ruby.html
https://github.com/aarongough/sexpistol
You might try the sxp-ruby gem at http://github.com/bendiken/sxp-ruby. I use it for SPARQL S-Expressions (SSE) and similar methods for managing Abstract Syntax Trees in Ruby.
Maybe you could have a look at this gem named Astrapi.
This is just an experiment :
describe your language elements (concepts) in a "mm" file (abstract syntax)
run astrapi on this file
astrapi generates a parser that is able to fill up your AST, from your input source expressed in s-expression (concrete syntax of your concepts).
I have put a modest documentation here.
I know i just need a file like /usr/share/gtksourceview-2.0/language-specs/javascript.lang. Where can i find a language definition like this for lex ?
You can find extra language definitions here, but it doesn't look like lex is among them. I think there may not be one yet. Here is a guide to writing your own.
I am learning how to use the version of fuzzyCLIPS from NRC. I would
appreciate if someone could point out some ftp/web sites with examples and
code using fuzzyCLIPS. I find the manual difficult to learn from
Try a search for FuzzyJess. As the syntax for CLIPS and Jess are similar you might find some FuzzyJess examples that can be adapted to FuzzyCLIPS.