/[svn]/linuxsampler/trunk/src/scriptvm/parser.y
ViewVC logotype

Diff of /linuxsampler/trunk/src/scriptvm/parser.y

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2910 by schoenebeck, Mon Apr 25 17:28:23 2016 UTC revision 2911 by schoenebeck, Mon May 16 20:27:33 2016 UTC
# Line 44  Line 44 
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
# Line 72  eventhandlers: Line 72  eventhandlers:
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();

Legend:
Removed from v.2910  
changed lines
  Added in v.2911

  ViewVC Help
Powered by ViewVC