directives: autoalias priorities: assign= 1 nonassoc range= 2 left unary = 3 right boolean_and_or = 4 left eq = 5 left if_else = 6 left plus_minus= 7 left star_slash= 8 left pow = 9 left tokens: plus= '\+' [plus_minus] minus= '-' [plus_minus] star= '\*' [star_slash] slash='\/' [star_slash] mod='%' [star_slash] pow='\^\^' [pow] band='&&' [boolean_and_or] bor='\|\|' [boolean_and_or] eq='==' [eq] neq='!=' [eq] lt='<' [eq] gt='>' [eq] le='<=' [eq] ge='>=' [eq] assign= '=' [assign] lpar= '\(' rpar= '\)' lcurl='\{' rcurl='\}' lopt='\[' ropt='\]' bang='!' [unary] dot='\.' range='\.\.' [range] colon=':' semicolon=';' comma=',' in="in" _if="if" _else="else" _for="for" _while="while" _do="do" _return="return" _break="break" _continue="continue" _this="this" print='print' print2file='print2file' _enum="enum" group="group" list="list" filter="filter" affect="affect" structure="structure" datafacer="datafacer" entity="entity" property="property" service="service" relation="relation" scenario="scenario" _const="const" global="global" _uses="uses" _boolean="boolean" _int="int" real="real" _void="void" none="\?" text="text" null_literal='null' boolean_literal="true|false" value_literal= "([0-9]+(\.([0-9])+)?)|(0[xX][0-9a-fA-F]+)" id= "([a-z]|[A-Z]|_)([a-z]|[A-Z]|[0-9]|_)*" text_value ="\u022([^\u022]|\\\u022)*\u022" hat = "@" [pow] blanks: space = "( |\t|\r|\n)+" comments: cplusplus_comment = "\/\/([^\r\n])*(\r)?\n" multiline_comment = "\/\*([^*]|[(\r)?\n]|(\*+([^*/]|((\r)?\n))))*\*+\/" error: error types: 'boolean_literal': boolean 'value_literal': Object 'id': String 'text_value': String starts: start productions: primitive_type = 'boolean' { primitive_type_boolean } | 'int' { primitive_type_int } | 'real' { primitive_type_real } ; relation_type = 'id' '[' type/'comma'+ ']' { relation_type } ; group_type = 'group' '[' type ']' { group_type } ; list_type = 'list' '[' type ']' { list_type } ; text_type = 'text' { text_type } ; type = 'id' { type_id } | primitive_type { type_primitive } | relation_type { type_relation } | group_type { type_group } | list_type { type_list } | text_type { type_text } ; affect_operator = field_access '<=' 'id' '=' field_access { affect_operator_def } ; start = script_member* { start } ; script_member = const_def { script_member_const_def } | affect_def { script_affect_def } | structure_def { script_structure_def } | datafacer_def { script_datafacer_def } | entity_def { script_member_entity_def } | relation_def { script_member_relation_def } | scenario_def { script_member_scenario_def } | uses_def { script_member_uses_def } ; affect_def = 'affect' type 'id' '(' parameters ')' block { affect_def } ; uses_def = 'uses' 'id' / 'dot' + ';' { uses_def } ; datafacer_def = 'datafacer' 'id' / 'dot' + ';' { datafacer_import_def } | 'datafacer' 'id' '{' datafacer_member* '}' { datafacer_member_def} ; datafacer_member = service_def { datafacer_member_service_def } | 'error' { datafacer_member_error } ; structure_def = 'structure' 'id' '{' structure_member* '}' { structure_def } ; structure_member = property_def { structure_member_property_def } | 'error' { structure_member_error } ; entity_def = 'entity' 'id' '{' entity_member* '}' { entity_def } ; entity_member = property_def { entity_member_property_def } | service_def { entity_member_service_def } | 'error' { entity_member_error } ; property_def = 'property' type 'id' property_init? ';' { property_def_type } | 'property' 'enum' 'id' '=' 'enum' '{' 'id'/'comma'+ '}' ';' { property_def_enum } | 'property' type 'id' 'hat' '[' 'value_literal' ']' property_init? ';' { property_def_history } ; property_init = '=' expr { property_init } ; relation_def = 'relation' 'id' '[' 'id'/'comma'+ ']' '{' relation_member* '}' { relation_def } ; relation_member = service_def { relation_member_service_def } | 'error' { relation_member_error } ; service_def = 'service' 'id' '(' parameters ')' abstract_or_block { service_def_void } | 'service' type 'id' '(' parameters ')' abstract_or_block { service_def_returntype } ; abstract_or_block = block { abstract_or_block_block } | ';' { abstract_or_block_semicolon } ; parameters = parameter_def/'comma'* { parameters } ; parameter_def = type 'id' { parameter_def } ; scenario_def = 'scenario' 'id' block { scenario_def } ; const_def = 'const' 'id' '=' expr ';' { const_def } ; block = '{' instr* '}' { block } ; instr = declaration ';' { instr_declaration } | filter_def ';' { instr_filter } | assignation ';' { instr_assignation } | funcall ';' { instr_funcall } | affect_operator ';' { instr_affect_operator } | 'print' expr ';' { instr_print } | 'print2file' '(' print_param ')' ';' { instr_print2file } | conditional { instr_conditional } | loop_label? loop { instr_loop } | 'break' 'id'? ';' { instr_break } | 'continue' 'id'? ';' { instr_continue } | 'return' expr? ';' { instr_return } | block { instr_block } | 'error' ';' { instr_error } ; print_param = 'id' 'comma' expr { print_parameters } ; declaration = type 'id' { declaration_id } | type 'id' '=' expr { declaration_id_init } | type 'id' 'hat' '[' 'value_literal' ']' { declaration_id_history } | type 'id' 'hat' '[' 'value_literal' ']' expr { declaration_id_init_history } | 'global' 'id' '=' expr { declaration_global } ; funcall = 'id' '(' arguments ')' { funcall_id } | 'id' '.' 'id' '(' arguments ')' { funcall_select } | primary '.' 'id' '(' arguments ')' { funcall_primary } | 'id' '(' 'error' ')' { funcall_error_id } | 'id' '.' 'id' '(' 'error' ')' { funcall_error_select } | primary '.' 'id' '(' 'error' ')' { funcall_error_primary } ; arguments = argument/'comma'* { arguments } ; argument = expr { argument_expr } | '?' { argument_none } ; conditional = 'if' '(' expr ')' block { conditional_if } | 'if' '(' expr ')' block 'else' block { conditional_if_else } | 'if' '(' 'error' ')' block { conditional_error_if } | 'if' '(' 'error' ')' block 'else' block { conditional_error_if_else } ; loop = 'while' '(' expr ')' block { loop_while } | 'do' block 'while' '(' expr ')' { loop_dowhile } | 'for' '(' for_loop_init? ';' expr? ';' for_loop_incr? ')' block { loop_for } | 'for' '(' 'id' 'in' expr ')' block { loop_foreach } | 'while' '(' 'error' ')' block { loop_error_while } | 'do' block 'while' '(' 'error' ')' { loop_error_dowhile } | 'for' '(' 'error' ')' block { loop_error_for } ; filter_def = 'id' '.' 'filter' '(' expr ')' { filter_declaration } ; for_loop_init = declaration { for_loop_init_declaration } | assignation { for_loop_init_assignation } | funcall { for_loop_init_funcall } ; for_loop_incr = assignation { for_loop_incr_assignation } | funcall { for_loop_incr_funcall } ; loop_label = 'id' ':' { loop_label } ; assignation = lhs '=' expr { assignation } ; lhs = 'id' { lhs_id } | field_access { lhs_field_access } ; primary = field_access { primary_field_access } | 'this' { primary_this } | '(' expr ')' { primary_parens } | 'id' '{' alloc_init* '}' { primary_allocation } | group_type { primary_group } | list_type { primary_list } | relation_type { primary_relation } | funcall { primary_funcall } | '(' 'error' ')' { primary_error_parens } | 'id' '{' 'error' '}' { primary_error_allocation } | 'group' '[' 'error' ']' { primary_error_group } | 'list' '[' 'error' ']' { primary_error_list } | 'id' '[' 'error' ']' { primary_error_relation } ; alloc_init = 'id' '=' expr ';' { alloc_init } ; field_access = 'id' '.' 'id' { field_access_id } | primary '.' 'id' { field_access_primary } | 'id' '.' 'id' 'hat' '[' 'value_literal' ']' { field_access_history } | 'id' '.' 'id' 'hat' '[' 'value_literal' '..' 'value_literal' ']' { field_access_history_range } ; expr = 'boolean_literal' { expr_boolean_literal } | 'value_literal' { expr_value_literal } | 'id' { expr_id } | primary { expr_primary } | expr '..' expr [range] { expr_range } | 'text_value' { expr_text_value } | '!' expr [unary] { expr_unary_not } | '+' expr [unary] { expr_unary_plus } | '-' expr [unary] { expr_unary_minus } | expr '==' expr [eq] { expr_eq } | expr '!=' expr [eq] { expr_ne } | expr '<' expr [eq] { expr_lt } | expr '<=' expr [eq] { expr_le } | expr '>' expr [eq] { expr_gt } | expr '>=' expr [eq] { expr_ge } | 'id' 'hat' '[' 'value_literal' ']' { expr_history } | expr '&&' expr [boolean_and_or] { expr_band } | expr '||' expr [boolean_and_or] { expr_bor } | expr '+' expr [plus_minus] { expr_plus } | expr '-' expr [plus_minus] { expr_minus } | expr '*' expr [star_slash] { expr_star } | expr '/' expr [star_slash] { expr_slash } | expr '%' expr [star_slash] { expr_mod } ;