Hi, I have a rule as follows:
firstOrderAtomic returns [Formula result] :
firstOrderAtomicHead[$first.result, $second.result] { $result =
$firstOrderAtomicHead.result;}
first=firstOrderVariable
second=firstOrderVariable ;
I hoped the rule firstOrderAtomicHead would receive the results from
first and second, but looking at the produced code, it doesn’t. How
would I do this to be able to pass the two variables to the head. I am
still working on a Lisp-like language, where this rule would e.g. match
(= x y)
and should produce new FirstOrderEquality(varX, varY), where varX and
varY are retrieved from a variable map or created if not present.
I think probably moving to an AST instead of trying to do this directly
in the parser would be a solution, but you probably can judge this
better, so that’s why I’m asking…
TIA, H.
--
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
signature.asc
Description: OpenPGP digital signature
List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address
