Trace the source code position in the lexer
This commit is contained in:
@ -2,17 +2,22 @@ DEFINITION MODULE Lexer;
|
||||
|
||||
FROM FIO IMPORT File;
|
||||
|
||||
FROM Common IMPORT Identifier, ShortString;
|
||||
FROM Common IMPORT Identifier, ShortString, TextLocation;
|
||||
|
||||
TYPE
|
||||
PLexerBuffer = POINTER TO CHAR;
|
||||
BufferPosition = RECORD
|
||||
iterator: PLexerBuffer;
|
||||
location: TextLocation
|
||||
END;
|
||||
PBufferPosition = POINTER TO BufferPosition;
|
||||
Lexer = RECORD
|
||||
input: File;
|
||||
buffer: PLexerBuffer;
|
||||
size: CARDINAL;
|
||||
length: CARDINAL;
|
||||
start: PLexerBuffer;
|
||||
current: PLexerBuffer
|
||||
start: BufferPosition;
|
||||
current: BufferPosition
|
||||
END;
|
||||
PLexer = POINTER TO Lexer;
|
||||
LexerKind = (
|
||||
@ -86,7 +91,9 @@ TYPE
|
||||
lexerKindIdentifier: identifierKind: Identifier |
|
||||
lexerKindInteger: integerKind: INTEGER |
|
||||
lexerKindString: stringKind: ShortString
|
||||
END
|
||||
END;
|
||||
start_location: TextLocation;
|
||||
end_location: TextLocation
|
||||
END;
|
||||
PLexerToken = POINTER TO LexerToken;
|
||||
|
||||
|
Reference in New Issue
Block a user