rzel / mini-java

Automatically exported from code.google.com/p/mini-java
0 stars 0 forks source link

Add Visitor interface and RegexVisitor implementation #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Visitor is an interface which will be referenced by the Symbol interface.
Visitor is both a context object and the extra behaviour one can add to the
Symbols. RegexVisitor should have a method that will return the final DFA
compiled from the AST.

Original issue reported on code.google.com by lemontree.cool on 2 Oct 2008 at 8:49

GoogleCodeExporter commented 9 years ago
I think it's better to rename Visitor to SymbolVisitor

Original comment by lemontree.cool on 2 Oct 2008 at 8:55

GoogleCodeExporter commented 9 years ago
SymbolVisitor should have two methods: visitTerminal() and visitNonTerminal(). 
And
for RegexVisitor, the visitNonTerminal() will first call accept() on its 
children and
then on itself. Basically it's a post-order traversal.

NOTE: It's better to put the traversal algorithm in the Visitor implementations.
Since such algorithm may vary according to the operation.

Original comment by lemontree.cool on 2 Oct 2008 at 9:01

GoogleCodeExporter commented 9 years ago

Original comment by lemontree.cool on 21 May 2009 at 3:12

GoogleCodeExporter commented 9 years ago

Original comment by lemontree.cool on 18 Jul 2009 at 11:46