blob: 9c5c7696b54c0d46e226d210fa0e1aa9dd9f8fe6 [file] [log] [blame]
FLOAT_LITERAL = [0-9]*\.[0-9]+([eE][+-]?[0-9]+)?|[0-9]+\.[0-9]*([eE][+-]?[0-9]+)?|[0-9]+([eE][+-]?[0-9]+)
INT_LITERAL = [0-9]+|0x[0-9a-fA-F]+
TRUE_LITERAL = "true"
FALSE_LITERAL = "false"
IF = "if"
STATIC_IF = "@if"
ELSE = "else"
FOR = "for"
WHILE = "while"
DO = "do"
SWITCH = "switch"
STATIC_SWITCH = "@switch"
CASE = "case"
DEFAULT = "default"
BREAK = "break"
CONTINUE = "continue"
DISCARD = "discard"
RETURN = "return"
IN = "in"
OUT = "out"
INOUT = "inout"
UNIFORM = "uniform"
CONST = "const"
LOWP = "lowp"
MEDIUMP = "mediump"
HIGHP = "highp"
FLAT = "flat"
NOPERSPECTIVE = "noperspective"
READONLY = "readonly"
WRITEONLY = "writeonly"
COHERENT = "coherent"
VOLATILE = "volatile"
RESTRICT = "restrict"
BUFFER = "buffer"
HASSIDEEFFECTS = "sk_has_side_effects"
STRUCT = "struct"
LAYOUT = "layout"
PRECISION = "precision"
ENUM = "enum"
CLASS = "class"
IDENTIFIER = [a-zA-Z_$]([0-9]|[a-zA-Z_$])*
DIRECTIVE = #[a-zA-Z_$]([0-9]|[a-zA-Z_$])*
SECTION = @[a-zA-Z_$]([0-9]|[a-zA-Z_$])*
LPAREN = "("
RPAREN = ")"
LBRACE = "{"
RBRACE = "}"
LBRACKET = "["
RBRACKET = "]"
DOT = "."
COMMA = ","
PLUSPLUS = "++"
MINUSMINUS = "--"
PLUS = "+"
MINUS = "-"
STAR = "*"
SLASH = "/"
PERCENT = "%"
SHL = "<<"
SHR = ">>"
BITWISEOR = "|"
BITWISEXOR = "^"
BITWISEAND = "&"
BITWISENOT = "~"
LOGICALOR = "||"
LOGICALXOR = "^^"
LOGICALAND = "&&"
LOGICALNOT = "!"
QUESTION = "?"
COLONCOLON = "::"
COLON = ":"
EQ = "="
EQEQ = "=="
NEQ = "!="
GT = ">"
LT = "<"
GTEQ = ">="
LTEQ = "<="
PLUSEQ = "+="
MINUSEQ = "-="
STAREQ = "*="
SLASHEQ = "/="
PERCENTEQ = "%="
SHLEQ = "<<="
SHREQ = ">>="
BITWISEOREQ = "|="
BITWISEXOREQ = "^="
BITWISEANDEQ = "&="
LOGICALOREQ = "||="
LOGICALXOREQ = "^^="
LOGICALANDEQ = "&&="
SEMICOLON = ";"
ARROW = "->"
WHITESPACE = \s+
LINE_COMMENT = //.*
BLOCK_COMMENT = /\*([^*]|\*[^/])*\*/
INVALID = .