Initial check in docu

This commit is contained in:
2026-01-03 18:31:15 +01:00
parent e2c3cbc520
commit ee130973e2
98 changed files with 9430 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
// ============================================================================
// Demo lexer for four operator calculator
// ============================================================================
unit calcLexer;
lexer TcalcLexer;
options
{
exportVocab = calcLexer;
}
// ============================================================================
// Simple tokens
// ============================================================================
LPAREN : '(';
RPAREN : ')';
PLUS : '+';
MINUS : '-';
STAR : '*';
SLASH : '/';
SEMI : ';';
// ============================================================================
// INT
// ============================================================================
INT : ('0'..'9')+;
// ============================================================================
// White space
// ============================================================================
WS
:
(
options
{
generateAmbigWarnings = false;
}
: '\r' '\n' { newLine; }
| '\r' { newLine; }
| '\n' { newLine; }
| '\t' { tab; }
| ' '
)
{
_ttype := TT_SKIP;
}
;