![]() |
AuD
Lecture 'Algorithmen und Datenstrukturen' (code examples)
|
Breaks input string into pieces ("tokens"). More...
Public Member Functions | |
Tokenizer (String input) | |
create new tokenizer for input More... | |
![]() | |
LexicalScanner (Rule[] rules, String input) | |
create new scanner processing input @endiliteral More... | |
void | setInput (String input) |
set input (resets scanner state) More... | |
String | matchedText () |
get text of last match or call to next More... | |
int | matchedTokenId () |
get result of last call to next() More... | |
String | remainder () |
get remaining text More... | |
boolean | endOfInput () |
reached end of input? More... | |
int | next () |
match remainder to rules provided to constructor More... | |
Static Public Attributes | |
static final int | LEFT_BRACE ='[' |
static final int | RIGHT_BRACE =']' |
static final int | LEFT_PAREN ='(' |
static final int | RIGHT_PAREN =')' |
static final int | AT ='@' |
static final int | COMMA =',' |
static final int | IDENTIFIER =0x100 |
static final int | NUMBER =0x101 |
static final int | EDGE =0x102 |
static final int | DEDGE =0x103 |
![]() | |
static final int | END_OF_INPUT = -1 |
no more input More... | |
static final int | NO_MATCH = -2 |
no match (usually implies a syntax error) More... | |
static final Pattern | P_WHITESPACE = Pattern.compile("\\s+") |
white space More... | |
static final Pattern | P_IDENTIFIER |
identifiers More... | |
static final Pattern | P_FLOAT |
floating point number More... | |
Static Protected Attributes | |
static final Pattern | P_LEFTBRACE = Pattern.compile("\\[") |
static final Pattern | P_RIGHTBRACE = Pattern.compile("\\]") |
static final Pattern | P_LEFTPAREN = Pattern.compile("\\(") |
static final Pattern | P_RIGHTPAREN = Pattern.compile("\\)") |
static final Pattern | P_EDGE = Pattern.compile("--") |
static final Pattern | P_DEDGE = Pattern.compile("->") |
static final Pattern | P_AT = Pattern.compile("@") |
static final Pattern | P_COMMA = Pattern.compile(",") |
static final LexicalScanner.Rule[] | RULES |
Additional Inherited Members | |
![]() | |
static void | main (String[] args) |
testing and example for usage More... | |
![]() | |
void | eatWhiteSpace () |
ignore white space (called by match More... | |
boolean | match (Pattern p) |
Match remainder against pattern p . More... | |
int | next (Rule[] rules) |
match remainder to table of rules @endiliteral More... | |
Breaks input string into pieces ("tokens").
Definition at line 10 of file graph/Tokenizer.java.
aud.example.graph.Tokenizer.Tokenizer | ( | String | input | ) |
create new tokenizer for input
Definition at line 49 of file graph/Tokenizer.java.
References aud.example.graph.Tokenizer.RULES.
|
static |
Definition at line 25 of file graph/Tokenizer.java.
Referenced by aud.example.graph.GraphParser.pos().
|
static |
Definition at line 26 of file graph/Tokenizer.java.
|
static |
Definition at line 31 of file graph/Tokenizer.java.
Referenced by aud.example.graph.GraphParser.edge().
|
static |
Definition at line 30 of file graph/Tokenizer.java.
Referenced by aud.example.graph.GraphParser.edge().
|
static |
Definition at line 28 of file graph/Tokenizer.java.
Referenced by aud.example.graph.GraphParser.node().
|
static |
Definition at line 21 of file graph/Tokenizer.java.
Referenced by aud.example.graph.GraphParser.weight().
|
static |
Definition at line 23 of file graph/Tokenizer.java.
Referenced by aud.example.graph.GraphParser.pos().
|
static |
Definition at line 29 of file graph/Tokenizer.java.
Referenced by aud.example.graph.GraphParser.node(), aud.example.graph.GraphParser.pos(), and aud.example.graph.GraphParser.weight().
|
staticprotected |
Definition at line 18 of file graph/Tokenizer.java.
|
staticprotected |
Definition at line 19 of file graph/Tokenizer.java.
|
staticprotected |
Definition at line 17 of file graph/Tokenizer.java.
|
staticprotected |
Definition at line 16 of file graph/Tokenizer.java.
|
staticprotected |
Definition at line 12 of file graph/Tokenizer.java.
|
staticprotected |
Definition at line 14 of file graph/Tokenizer.java.
|
staticprotected |
Definition at line 13 of file graph/Tokenizer.java.
|
staticprotected |
Definition at line 15 of file graph/Tokenizer.java.
|
static |
Definition at line 22 of file graph/Tokenizer.java.
|
static |
Definition at line 24 of file graph/Tokenizer.java.
|
staticprotected |
Definition at line 34 of file graph/Tokenizer.java.
Referenced by aud.example.graph.Tokenizer.Tokenizer().