blob: 9c5c7696b54c0d46e226d210fa0e1aa9dd9f8fe6 [file] [log] [blame]
Ethan Nicholasca82a922017-09-07 09:39:50 -04001FLOAT_LITERAL = [0-9]*\.[0-9]+([eE][+-]?[0-9]+)?|[0-9]+\.[0-9]*([eE][+-]?[0-9]+)?|[0-9]+([eE][+-]?[0-9]+)
2INT_LITERAL = [0-9]+|0x[0-9a-fA-F]+
3TRUE_LITERAL = "true"
4FALSE_LITERAL = "false"
5IF = "if"
6STATIC_IF = "@if"
7ELSE = "else"
8FOR = "for"
9WHILE = "while"
10DO = "do"
11SWITCH = "switch"
12STATIC_SWITCH = "@switch"
13CASE = "case"
14DEFAULT = "default"
15BREAK = "break"
16CONTINUE = "continue"
17DISCARD = "discard"
18RETURN = "return"
19IN = "in"
20OUT = "out"
21INOUT = "inout"
22UNIFORM = "uniform"
23CONST = "const"
24LOWP = "lowp"
25MEDIUMP = "mediump"
26HIGHP = "highp"
27FLAT = "flat"
28NOPERSPECTIVE = "noperspective"
29READONLY = "readonly"
30WRITEONLY = "writeonly"
31COHERENT = "coherent"
32VOLATILE = "volatile"
33RESTRICT = "restrict"
34BUFFER = "buffer"
35HASSIDEEFFECTS = "sk_has_side_effects"
36STRUCT = "struct"
37LAYOUT = "layout"
38PRECISION = "precision"
Ethan Nicholasaae47c82017-11-10 15:34:03 -050039ENUM = "enum"
40CLASS = "class"
Ethan Nicholasca82a922017-09-07 09:39:50 -040041IDENTIFIER = [a-zA-Z_$]([0-9]|[a-zA-Z_$])*
42DIRECTIVE = #[a-zA-Z_$]([0-9]|[a-zA-Z_$])*
43SECTION = @[a-zA-Z_$]([0-9]|[a-zA-Z_$])*
44LPAREN = "("
45RPAREN = ")"
46LBRACE = "{"
47RBRACE = "}"
48LBRACKET = "["
49RBRACKET = "]"
50DOT = "."
51COMMA = ","
52PLUSPLUS = "++"
53MINUSMINUS = "--"
54PLUS = "+"
55MINUS = "-"
56STAR = "*"
57SLASH = "/"
58PERCENT = "%"
59SHL = "<<"
60SHR = ">>"
61BITWISEOR = "|"
62BITWISEXOR = "^"
63BITWISEAND = "&"
64BITWISENOT = "~"
65LOGICALOR = "||"
66LOGICALXOR = "^^"
67LOGICALAND = "&&"
68LOGICALNOT = "!"
69QUESTION = "?"
Ethan Nicholasaae47c82017-11-10 15:34:03 -050070COLONCOLON = "::"
Ethan Nicholasca82a922017-09-07 09:39:50 -040071COLON = ":"
72EQ = "="
73EQEQ = "=="
74NEQ = "!="
75GT = ">"
76LT = "<"
77GTEQ = ">="
78LTEQ = "<="
79PLUSEQ = "+="
80MINUSEQ = "-="
81STAREQ = "*="
82SLASHEQ = "/="
83PERCENTEQ = "%="
84SHLEQ = "<<="
85SHREQ = ">>="
86BITWISEOREQ = "|="
87BITWISEXOREQ = "^="
88BITWISEANDEQ = "&="
89LOGICALOREQ = "||="
90LOGICALXOREQ = "^^="
91LOGICALANDEQ = "&&="
92SEMICOLON = ";"
93ARROW = "->"
Ethan Nicholasca82a922017-09-07 09:39:50 -040094WHITESPACE = \s+
95LINE_COMMENT = //.*
96BLOCK_COMMENT = /\*([^*]|\*[^/])*\*/
97INVALID = .