unit prgLexer; // ---------------------------------------------------------------------------- // This section is used for generating "uses" clause in the unit 'prgLexer'. // Every unit name must be terminated with ';' // e.g: // // uses // { // Classes; // SysUtils; // } // ---------------------------------------------------------------------------- uses { } // ---------------------------------------------------------------------------- // This section is used for generating "const" clause in the unit 'prgLexer'. // The content of the section is verbatim copied into the generated code. // ---------------------------------------------------------------------------- //const //{ //} // ---------------------------------------------------------------------------- // This section is used for generating "type" clause in the unit 'prgLexer'. // The content of the section is verbatim copied into the generated code. // ---------------------------------------------------------------------------- type { } // ============================================================================ // Lexer class declaration // ============================================================================ lexer TprgLexer; // ---------------------------------------------------------------------------- // Lexer options // ---------------------------------------------------------------------------- options { k = 2; exportVocab = prgLexer; caseSensitive = false; } // ---------------------------------------------------------------------------- // Lexer tokens. Usualy string literals. // ---------------------------------------------------------------------------- tokens { "dso"; "jtag"; "fx2"; "/list"; "/id"; "/pos"; "/loc"; "/perm"; "/cmd"; "/v"; "/v1"; QID; } // ---------------------------------------------------------------------------- // Lexer member declarations. // All user defined member declarations should be placed here. // The content of the section is verbatim copied into the generated code. // ---------------------------------------------------------------------------- memberdecl { } // ============================================================================ // Begin rule definitions // // Remember: All lexer rule names must begin with UPPERCASE letter! // ============================================================================ //SLASH : '/'; COMMA : ','; COLON : ':'; PLUS : '+'; MINUS : '-'; DOT : '.'; EQ : '='; // STAR : '*'; ID options { testLiterals = true; } : ('A'..'Z' | 'a'..'z' | '/' | '&' | '*') ( 'A'..'Z' | 'a'..'z' | '0'..'9' | '&' | '*' | '_' | '.' { _ttype := TT_QID; } )* ; INT : ('0'..'9')('0'..'9')*; REXP : "<"! (~(">"))* ">"!; // ---------------------------------------------------------------------------- // NEWLINE // ---------------------------------------------------------------------------- NEWLINE : ( options { generateAmbigWarnings = false; } : '\r' '\n' { newLine; } | '\r' { newLine; } | '\n' { newLine; } ) { _ttype := TT_SKIP; } ; // ---------------------------------------------------------------------------- // WHITESPACE // ---------------------------------------------------------------------------- WS : ( ' ' | '\t' { tab; } ) // { // _ttype := TT_SKIP; // } ; // ============================================================================ // End rule definitions // ============================================================================ // ---------------------------------------------------------------------------- // This section is used for generating member defintions in the unit 'prgLexer'. // The content of the section is verbatim copied into the generated code. // ---------------------------------------------------------------------------- memberdef { }