Version française
Home     About     Download     Resources     Contact us    
Browse thread
yacc style
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Chris King <colanderman@g...>
Subject: yacc style
I'm defining a grammar which, when parsed, returns an imperative
structure (i.e. one which can't easily be created in a functional
style).  ocamlyacc is making this difficult for me, since there's no
clean way to pass to the main parser function a structure on which to
operate.  Right now I'm getting around this by defining global
references in the header of the parser and setting them before each
call to the parser main function.  Is it considered better style to
instead have the parser return a parse tree, and then use that to
generate the imperative structure, or is there a more direct way to do
what I want to do?

Thanks!