polemy.lex
Authors:
k.inaba
License:
NYSL 0.9982 http://www.kmonos.net/nysl/
Lexer for Polemy programming language.
- class
Token
;
- Represents a lexer token
- immutable LexPosition
pos
;
- Position where the token occurred in the source
- immutable string
str
;
- The token string itself
- immutable bool
quoted
;
- Was it a "
quoted
" token or unquoted?
- Lexer
lexerFromFile
(T...)(string filename, T ln_cn);
- Named Construtors for Lexer
- LexerT!(PositionedReader!(CharSeq))
lexerFromString
(CharSeq)(CharSeq str, string filename = "<unnamed>", int lineno = 1, int column = 1);
- Named Construtor for Lexer
- alias
Lexer
;
- Standard
Lexer
Type (all you have to know is that this is a forward range of Tokens!)
- class
LexerT
(Reader) if (isForwardRange!(Reader) && is(ElementType!(Reader) == dchar));
- Lexer Implementation
- bool
empty
();
- Range primitive
- Token
front
();
- Range primitive
- void
popFront
();
- Range primitive
- typeof(this)
save
();
- Range primitive
- struct
PositionedReader
(CharSeq) if (isForwardRange!(CharSeq) && is(ElementType!(CharSeq) == dchar));
- Forward range for reader character by character,
keeping track of position information and caring \r\n -> \n conversion.
- bool
empty
();
- Range primitive
- dchar
front
();
- Range primitive
- void
popFront
();
- Range primitive
- typeof(this)
save
();
- Range primitive
- const LexPosition
currentPosition
();
- Get the current position
|