I have just completed the recognition part of a GLL (generalised LL)
parser generator in go. GLL handles all context free grammars and
since it parses top down has the nice feature that the generated code
is human readable. See Scott & Johnstone, GLL Parsing, Electronic
Notes in Theoretical Computer Science, 253, 2010. I have used it to
generate a parser for ASN.1, which is emphatically not LR1.
I am currently working on the specification of translation actions for
the parser generator. My plan is to generate an abstract syntax tree
(AST) from a syntax directed translation scheme (SDT) embedded in the
grammar of the language the parser is generated for. You walk the AST
for semantic analysis and code generation.
I earlier wrote an LR1 parser generator in go, which uses the
following notation for translation actions (extract from the input
grammar of the parser generator):
Grammar : Production << ast.NewProdS($0) >>
| Production Grammar << $0.Append($1...) >>
;
The SDT is between angle brackets on the right of the production. $x
refers to the index of a symbol in the respective alternate body of
the production. ast.NewProdS and Symbol.Append are functions in an AST
package I write for this compiler.
Without external input I will probably end up with something similar
for the GLL parser generator. Let me know if you are interested to use
it or to discuss the specification notation of the SDT.
If your language is not LALR this parser generator will handle it as
long as it is a CFG. Currently you have to write the lexer yourself.
If your language is LALR, goyacc is better documented and is
available.
On the other hand, my generator goes by the nice name: gogll,
pronounced: "goggle". And that should count for something.
Regards,
Marius
On Oct 12, 1:42 am, John David Duncan <
john.david.dun...@gmail.com>
wrote: