small medium large xlarge

Generic-user-small
01 Nov 2016, 15:36
Lin Zhang (8 posts)

I am reading “The Definitive ANTLR 4 Reference.” I have a question in the section of 4.4 Embedding Arbitrary Actions in a Grammar (p.48).

~~~
$ java Col 1 < t.rows
~~~

I get lost here. Here are my questions: i) Why is there a “<” sign here? ii) What is the “tokens” like in this example out of “CommonTokenStream tokens = new CommonTokenStream(lexer);” iii) How does the method of RowsParser(TokenStream input, int col) work here?

Thank you for your time and help!

Ter-brew-pub_pragsmall
04 Nov 2016, 13:28
Terence Parr (50 posts)

Hi. That < means “redirect standard input” from the UNIX shell. I suggest looking that up to learn more about using tools from the commandline.

tokens is a list or buffer of tokens.

RowsParser(TokenStream input, int col) is a constructor call, whose definition you will find inside Rows.g4.

Terence

You must be logged in to comment