Language tokens (Reserved keywords)
//
// token
//
| <YACTIVATED: "activated">
| <YALL: "all">
| <YALLCASE: "ALL_CASE">
| <YAND: "and">
| <YAPPLICATION: "application">
| <YARRAY: "array">
| <YBOOLEAN: "boolean">
| <YBREAK: "break">
| <YBY: "by">
| <YCELL: "cell">
| <YCHAR: "char">
| <YCONTINUE: "continue">
| <YCORRELATED: "correlated">
| <YDESC: "desc">
| <YDISCARD: "discard">
| <YDISTINCT: "distinct">
| <YDO: "do">
| <YDOUBLE: "double">
| <YELSE: "else">
| <YEND: "end">
| <YENUM: "enum">
| <YEVENT: "event">
| <YEXCEPT: "except">
| <YEXISTS: "exists">
| <YFALSE: "false">
| <YFINALIZE: "finalize">
| <YFIRSTSUCCESS: "FIRST_SUCCESS">
| <YFLOAT: "float">
| <YFN: "fn">
| <YFOR: "for">
| <YFROM: "from">
| <YFUN: "fun">
| <YGROUP: "group">
| <YIF: "if">
| <YIMPORT: "import">
| <YIN: "in">
| <YINSTANCE: "instance">
| <YINDEX: "INDEX">
| <YINFOPAD: "infopad">
| <YINITIALIZE: "initialize">
| <YINT: "int">
| <YINTERSECT: "intersect">
| <YITERATOR: "iterator">
| <YLET: "let">
| <YLETREC: "letrec">
| <YLIKE: "like">
| <YLIST: "list">
| <YMAP: "map">
| <YMODULE: "module">
| <YNEW: "new">
| <YNIL: "nil">
| < NOT: "not" >
| <YOBJECT: "object">
| <YOF: "of">
| <YOR: "or">
| <YPERSISTENT: "persistent">
| <YPRIVATE: "private">
| <YPUBLIC: "public">
| <YRETURN: "return">
| <YRULE: "rule">
| <YSELECT: "select">
| <YSET: "set">
| <YSINGLECASE: "SINGLE_CASE">
| <YSOME: "some">
| <YSTRING: "string">
| <YTERMINATED: "terminated">
| <YTHEN: "then">
| <YTRANSIENT: "transient">
| <YTRIGGER: "trigger">
| <YTRUE: "true">
| <YTRY: "try">
| <YTYPE: "type">
| <YUNION: "union">
| <YUNIT: "unit">
| <YVAL: "val">
| <YVAR: "var">
| <YVOID: "void">
| <YWHERE: "where">
| <YWHILE: "while">
| <YWITH: "with">
| <YGENERATE: "generate">
| <YSCHEDULE: "schedule">
| <YPERFORM: "perform">
| <YUNSCHEDULE: "unschedule">
| <YENDOFKEYWORD: "__end_of_keyword__"> // dummy
| <YEAR: "Y"|"YEA"|"YEAR">
| <MONTH: "M"|"MON"|"MONTH">
| <DAY: "D"|"DAY">
| <HOUR: "H"|"HOU"|"HOUR">
| <MIN: "N"|"MIN">
| <SEC: "S"|"SEC">
| <NOW: "NOW">
// BPDecoder
| <BPD_version: "__VERSION__" >
| <BPD_timestamp: "__TIMESTAMP__" >
}TOKEN :
{ < ID: <LETTER> (<LETTER>|<DIGIT>)* >
| < #LETTER:
[
"\u0024", // "$"
"\u0041"-"\u005a", // "A" - "Z"
"\u005f", // "_"
"\u0061"-"\u007a", // "a"-"z"
"\u00c0"-"\u00d6", // "‘A"- "..O"
"\u00d8"-"\u00f6", // "‘a"-"..o"
"\u00f8"-"\u00ff", // "o/"-"..y"
"\u0100"-"\u1fff",//latin_extended_a, latin_extended_b(from 0180-1fff)
"\u3040"-"\u318f",// hiragana, katakana, bopomofo, hangl_compatibility_jamo
"\u3300"-"\u337f",//cjk_compatibility(except 3380-33ff)
"\u3400"-"\u3d2d",// not used..?? 4db5
"\u4e00"-"\u9fff",// cjk_unified_ideographs
"\uf900"-"\ufaff",// cjk_compatibility_ideographs
] >
| < #DIGIT:
[
"\u0030"-"\u0039", // "0"-"9"
"\u0660"-"\u0669", // arabic
"\u06f0"-"\u06f9", // arabic
"\u0966"-"\u096f", // devanagari
"\u09e6"-"\u09ef",// devanagari
"\u0a66"-"\u0a6f",//gurmukhi
"\u0ae6"-"\u0aef",//grumukhi
"\u0b66"-"\u0b6f",//oriya
"\u0be7"-"\u0bef",//oriya
"\u0c66"-"\u0c6f", // telugu
"\u0ce6"-"\u0cef", // telugu
"\u0d66"-"\u0d6f", // malayalam
"\u0e50"-"\u0e59", // thai
"\u0ed0"-"\u0ed9",//lao
"\u1040"-"\u1049" //??
]
>
}TOKEN :
{ < INTEGER_LITERAL:
<DECIMAL_LITERAL> (["l","L"])?
| <HEX_LITERAL> (["l","L"])?
| <OCTAL_LITERAL> (["l","L"])?
>
| < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* >
| < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ >
| < #OCTAL_LITERAL: "0" (["0"-"7"])* >
| < FLOATING_POINT_LITERAL:
(["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? (["f","F","d","D"])?
| "." (["0"-"9"])+ (<EXPONENT>)? (["f","F","d","D"])?
| (["0"-"9"])+ <EXPONENT> (["f","F","d","D"])?
| (["0"-"9"])+ (<EXPONENT>)? ["f","F","d","D"]
>
| < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ >
| < #HEXCAHR : ["a"-"z","A"-"Z","0"-"9"] >
| < #CHARCODE : ("\\" ( ["b","t","n","f","r","\"","’","\\"]
| "u" <HEXCAHR> <HEXCAHR> <HEXCAHR> <HEXCAHR>
| ["0"-"7"] ( ["0"-"7"] )?
| ["0"-"3"] ["0"-"7"] ["0"-"7"]
)) >
| < CHARACTER : "‘" ( (~["‘","\\","\n","\r"]) | <CHARCODE> ) "‘" >
| < STRING : "\"" ( (~["\"","\\","\n","\r"]) | <CHARCODE> )* "\"" >
}