Package org.oristool.lello.parse
Class Terminal
java.lang.Object
org.oristool.lello.parse.Terminal
Represents a terminal symbol. A terminal symbol consists of a kind, which
influences the behavior (precedence, associativity, etc...) of the parser
when it encounters the symbol, and a string called token that specifies the
exact form in which the token was written within the input file; the token
influences evaluation and AST manipulation. In order to allow accurate error
reporting every token stores the row and column number where it was located
in the input file.
-
Constructor Summary
ConstructorDescriptionTerminal
(TerminalKind kind, String token, int row, int col) Initializes a new terminal symbol. -
Method Summary
Modifier and TypeMethodDescriptionint
getCol()
Retrieves the column number in the input file at which this terminal symbol was located.getKind()
Retrieves the kind of the terminal symbol.int
getRow()
Retrieves the row number in the input file at which this terminal symbol was located.getToken()
Retrieves the token of the terminal symbol.
-
Constructor Details
-
Terminal
Initializes a new terminal symbol.- Parameters:
kind
- The kind of the terminal symbol.token
- The token of the terminal symbol.row
- The row number in the input file at which this terminal symbol was located.col
- The column number in the input file at which this terminal symbol was located.
-
-
Method Details
-
getKind
Retrieves the kind of the terminal symbol.- Returns:
- The kind of the terminal symbol.
-
getToken
Retrieves the token of the terminal symbol.- Returns:
- The token of the terminal symbol.
-
getRow
public int getRow()Retrieves the row number in the input file at which this terminal symbol was located.- Returns:
- Row number.
-
getCol
public int getCol()Retrieves the column number in the input file at which this terminal symbol was located.- Returns:
- Column number.
-