railt/compiler

View on GitHub
src/Compiler/Resources/pp2/lexer.pp2

Summary

Maintainability
Test Coverage

%token T_PRAGMA                 %pragma\h+([\w\.]+)\h+([^\s]+)
%token T_INCLUDE                %include\h+([^\s]+)
%token T_TOKEN                  %token\h+(\w+)\h+([^\s]+)
%token T_SKIP                   %skip\h+(\w+)\h+([^\s]+)
%token T_OR                     \|
%token T_TOKEN_SKIPPED          ::(\w+)::
%token T_TOKEN_KEPT             <(\w+)>
%token T_TOKEN_STRING           ("[^"\\]+(\\.[^"\\]*)*"|'[^'\\]+(\\.[^'\\]*)*')
%token T_INVOKE                 (\w+)\(\)
%token T_GROUP_OPEN             \(
%token T_GROUP_CLOSE            \)
%token T_REPEAT_ZERO_OR_ONE     \?
%token T_REPEAT_ONE_OR_MORE     \+
%token T_REPEAT_ZERO_OR_MORE    \*
%token T_REPEAT_N_TO_M          {\h*(\-?\d+)\h*,\h*(\-?\d+)\h*}
%token T_REPEAT_N_OR_MORE       {\h*(\-?\d+)\h*,\h*}
%token T_REPEAT_ZERO_TO_M       {\h*,\h*(\-?\d+)\h*}
%token T_REPEAT_EXACTLY_N       {\h*(\-?\d+)\h*}
%token T_KEPT_NAME              #
%token T_NAME                   [a-zA-Z_\x7f-\xff\\][a-zA-Z0-9_\x7f-\xff\\]*
%token T_EQ                     (\:|\:\:=|=)
%token T_DELEGATE               \->
%token T_END_OF_RULE            ;

%skip T_WHITESPACE             (\xfe\xff|\x20|\x09|\x0a|\x0d)+
%skip T_COMMENT                //[^\n]*
%skip T_BLOCK_COMMENT          /\*.*?\*/