CSc 4340/6340, Introduction to Compilers
Spring 2012
PROJECT (DatalogQ/Datalog) - Lexical Specification

DatalogQ Lexical Specification

TOKENRegular ExpressionType
DOLLAR$Fixed symbol
IMPLIES:-Fixed symbol
PERIOD.Fixed symbol
COMMA,Fixed symbol
LPAREN(Fixed symbol
RPAREN)Fixed symbol
LBRACKET[Fixed symbol
RBRACKET]Fixed symbol
COLON:Fixed symbol
STAR*Fixed symbol
HASH#Fixed symbol
NOTOP[nN][oO][tT]Fixed keyword
NAME[a-z][_A-Za-z0-9]*Variable token
COMPARISON= | < | > | <> | <= | >=Variable token
NUMBER[0-9]+ | [0-9]+"."[0-9]+ | "."[0-9]+Variable token
STRING['][^'\r\n]*[']Variable token
VARIABLE[_A-Z][_A-Za-z0-9]*Variable token

Datalog Lexical Specification (for undergraduates)

TOKENRegular ExpressionType
DOLLAR$Fixed symbol
IMPLIES:-Fixed symbol
PERIOD.Fixed symbol
COMMA,Fixed symbol
LPAREN(Fixed symbol
RPAREN)Fixed symbol
NOTOP[nN][oO][tT]Fixed keyword
NAME[a-z][_A-Za-z0-9]*Variable token
COMPARISON= | < | > | <> | <= | >=Variable token
NUMBER[0-9]+ | [0-9]+"."[0-9]+ | "."[0-9]+Variable token
STRING['][^'\r\n]*[']Variable token
VARIABLE[_A-Z][_A-Za-z0-9]*Variable token