44 |
|
|
45 |
%type <nEventHandlers> script eventhandlers |
%type <nEventHandlers> script eventhandlers |
46 |
%type <nEventHandler> eventhandler |
%type <nEventHandler> eventhandler |
47 |
%type <nStatements> statements |
%type <nStatements> statements body |
48 |
%type <nStatement> statement assignment |
%type <nStatement> statement assignment |
49 |
%type <nFunctionCall> functioncall |
%type <nFunctionCall> functioncall |
50 |
%type <nArgs> args |
%type <nArgs> args |
72 |
} |
} |
73 |
|
|
74 |
eventhandler: |
eventhandler: |
75 |
ON NOTE statements END ON { |
ON NOTE body END ON { |
76 |
if (context->onNote) |
if (context->onNote) |
77 |
PARSE_ERR(@2, "Redeclaration of 'note' event handler."); |
PARSE_ERR(@2, "Redeclaration of 'note' event handler."); |
78 |
context->onNote = new OnNote($3); |
context->onNote = new OnNote($3); |
79 |
$$ = context->onNote; |
$$ = context->onNote; |
80 |
} |
} |
81 |
| ON INIT statements END ON { |
| ON INIT body END ON { |
82 |
if (context->onInit) |
if (context->onInit) |
83 |
PARSE_ERR(@2, "Redeclaration of 'init' event handler."); |
PARSE_ERR(@2, "Redeclaration of 'init' event handler."); |
84 |
context->onInit = new OnInit($3); |
context->onInit = new OnInit($3); |
85 |
$$ = context->onInit; |
$$ = context->onInit; |
86 |
} |
} |
87 |
| ON RELEASE statements END ON { |
| ON RELEASE body END ON { |
88 |
if (context->onRelease) |
if (context->onRelease) |
89 |
PARSE_ERR(@2, "Redeclaration of 'release' event handler."); |
PARSE_ERR(@2, "Redeclaration of 'release' event handler."); |
90 |
context->onRelease = new OnRelease($3); |
context->onRelease = new OnRelease($3); |
91 |
$$ = context->onRelease; |
$$ = context->onRelease; |
92 |
} |
} |
93 |
| ON CONTROLLER statements END ON { |
| ON CONTROLLER body END ON { |
94 |
if (context->onController) |
if (context->onController) |
95 |
PARSE_ERR(@2, "Redeclaration of 'controller' event handler."); |
PARSE_ERR(@2, "Redeclaration of 'controller' event handler."); |
96 |
context->onController = new OnController($3); |
context->onController = new OnController($3); |
97 |
$$ = context->onController; |
$$ = context->onController; |
98 |
} |
} |
99 |
|
|
100 |
|
body: |
101 |
|
/* epsilon (empty argument) */ { |
102 |
|
$$ = new Statements(); |
103 |
|
} |
104 |
|
| statements { |
105 |
|
$$ = $1; |
106 |
|
} |
107 |
|
|
108 |
statements: |
statements: |
109 |
statement { |
statement { |
110 |
$$ = new Statements(); |
$$ = new Statements(); |