python 3.4 - Antlr4 Python3 target visitor not usable? -
i try follow antlr4 reference book, python3 target, got stuck in calculator example. on antlr4 docs says
the python implementation of antlr close possible java one, shouldn't find difficult adapt examples python
but don't yet.
the java code visitor has .visit
method , in python don't have method. think it's because in java visit method had parameter overloads of tokens. in python have visitprog()
, visitassign()
, visitid()
etc. can't write value = self.visit(ctx.expr())
because don't know visit call?
or missing instruction somewhere?
the python2/3 targets not yet have visitor implemented. tried implement myself, , pull request send antlr guy see if did correctly. follow pull request here: https://github.com/antlr/antlr4-python3/pull/6
Comments
Post a Comment