|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.StreamTokenizer | +--chat.Lexer
Implementazione del lexer specifico per la seguente grammatica:
scopo ::= nome / chiave @ endpoint
nome ::= ( a |...| z | A |...| Z | 0 |...| 9 | _ | $ ) { a |...| z | A |...| Z | 0 |...| 9 | _ | $ }31
chiave ::= numero { , numero }
endpoint ::= ip : numero { @ ip : numero }
ip ::= numero . numero . numero . numero
numero ::= 0 [ x cifra-hex { cifra-hex } | { cifra } ] | cifra-non-nulla { cifra }
cifra ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
cifra-non-nulla ::= 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
cifra-hex ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | a | b | c | d | e | f | A | B | C | D | E | F
Sono riconosciuti i commenti in stile C e C++.
Fields inherited from class java.io.StreamTokenizer |
buf,
CT_ALPHA,
CT_COMMENT,
CT_DIGIT,
CT_QUOTE,
CT_WHITESPACE,
ctype,
eolIsSignificantP,
forceLower,
input,
LINENO,
NEED_CHAR,
nval,
peekc,
pushedBack,
reader,
SKIP_LF,
slashSlashCommentsP,
slashStarCommentsP,
sval,
TT_EOF,
TT_EOL,
TT_NOTHING,
TT_NUMBER,
TT_WORD,
ttype |
Constructor Summary | |
(package private) |
Lexer(java.io.Reader r)
Unico costruttore che inizializza il lexer con i caratteri separatori specificati dalla grammatica. |
Method Summary | |
int |
nextToken()
Specializzazione di java.io.StreamTokenizer.nextToken()
per il corretto parsing dei numeri (naturali in notazione decimale ed
esadecimale Java-like, prefissati cioč da 0x ). |
(package private) java.lang.String |
tokenCorrente()
Funzione che ritorna una rappresentazione testuale del token corrente ultimo estratto dallo stream. |
Methods inherited from class java.io.StreamTokenizer |
commentChar,
eolIsSignificant,
lineno,
lowerCaseMode,
ordinaryChar,
ordinaryChars,
parseNumbers,
pushBack,
quoteChar,
read,
resetSyntax,
slashSlashComments,
slashStarComments,
toString,
whitespaceChars,
wordChars |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
Lexer(java.io.Reader r)
r
- il java.io.Reader
su cui
poggiare questa specializzazione di
java.io.StreamTokenizer
.Method Detail |
public int nextToken() throws java.io.IOException
java.io.StreamTokenizer.nextToken()
per il corretto parsing dei numeri (naturali in notazione decimale ed
esadecimale Java-like, prefissati cioč da 0x
).java.io.StreamTokenizer.ttype
, cioč il tipo del token letto.java.io.StreamTokenizer.nextToken()
.java.lang.String tokenCorrente()
""
in caso di End Of File.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |