This project has moved and is read-only. For the latest updates, please go here.

Converting from Yacc/Lex

Apr 21, 2012 at 11:12 PM

I have a grammar in Yacc/Lex that I would like to convert to Irony (and also convert the entire program from C to C# mind you xD), but I've stumbled across one thing that I don't know how to handle.

The parser-file (parser.y) has stuff like this defined:

    statement_list RIGHT_CURLY_BRACKET
             $$ = MakeBlockStatement($2);


How would I go about achieving the same thing in Irony?

Apr 23, 2012 at 6:20 PM

the fragment you show, as far as I can guess, mixes syntax rule (block= "{" + stmt_list + "}" ), and interpreter, runtime rule (create nested scope when entering the block). 

The syntax rule in Irony is expressed the usual way.

Scope creation - it should be done by an AST node for a block element, this is part of interpreter behavior.