xephonhq / tsdb-ql

(Deprecated) A Time Series Database Query Language, see https://github.com/libtsdb and https://github.com/at15/reika
MIT License
5 stars 0 forks source link

ANTLR Golang visitor pattern implementation/example #4

Closed at15 closed 6 years ago

at15 commented 7 years ago

Related #3 https://github.com/pboyer/antlr4/issues/93

Comparing the Java code and the Go runtime, the visit method should call tree.accept(visitor)

The code is in AbstractParseTreeVisitor.java

    public T visit(ParseTree tree) {
        return tree.accept(this);
    }
at15 commented 7 years ago

another way is to get ride of ANTLR and write a raw parser in Go, but this lost the portability to other language. example: https://blog.gopheracademy.com/advent-2014/parsers-lexers/

at15 commented 7 years ago

there are on going work for visitor pattern's in go https://github.com/antlr/antlr4/pull/1841 , though it looks it would still take some time before it got merged

at15 commented 6 years ago

close due to archive repo