/[svn]/linuxsampler/trunk/src/scriptvm/scanner.l
ViewVC logotype

Diff of /linuxsampler/trunk/src/scriptvm/scanner.l

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

revision 2889 by schoenebeck, Mon Apr 25 17:28:23 2016 UTC revision 2935 by schoenebeck, Sun Jul 10 14:24:13 2016 UTC
# Line 96  static int countCharsPastLastNewLine(con Line 96  static int countCharsPastLastNewLine(con
96  %x PREPROC_SET_COND PREPROC_RESET_COND PREPROC_IF PREPROC_IF_NOT PREPROC_BODY_EAT PREPROC_PRE_BODY_USE PREPROC_PRE_BODY_EAT  %x PREPROC_SET_COND PREPROC_RESET_COND PREPROC_IF PREPROC_IF_NOT PREPROC_BODY_EAT PREPROC_PRE_BODY_USE PREPROC_PRE_BODY_EAT
97    
98  DIGIT    [0-9]  DIGIT    [0-9]
99  ID       [a-zA-Z0-9_]*  ID       [a-zA-Z0-9_]+
100    
101  %%  %%
102    
# Line 111  ID       [a-zA-Z0-9_]* Line 111  ID       [a-zA-Z0-9_]*
111      return INTEGER;      return INTEGER;
112  }  }
113    
114  {DIGIT}+"."{DIGIT}* {   /* there is currently no support for floating point numbers in NKSP yet */
115     /*{DIGIT}+"."{DIGIT}* {
116      printf("A float: %s (%g)\n", yytext, atof(yytext));      printf("A float: %s (%g)\n", yytext, atof(yytext));
117  }   }*/
118    
119    
120   /* Preprocessor statement:  SET_CONDITION(name) */   /* Preprocessor statement:  SET_CONDITION(name) */
# Line 223  ID       [a-zA-Z0-9_]* Line 224  ID       [a-zA-Z0-9_]*
224  "declare" return DECLARE;  "declare" return DECLARE;
225  "while" return WHILE;  "while" return WHILE;
226  "if" return IF;  "if" return IF;
227    ".or." return BITWISE_OR;
228  "or" return OR;  "or" return OR;
229  "release" return RELEASE;  "release" return RELEASE;
230    ".and." return BITWISE_AND;
231  "and" return AND;  "and" return AND;
232    ".not." return BITWISE_NOT;
233  "not" return NOT;  "not" return NOT;
234  "else" return ELSE;  "else" return ELSE;
235  "controller" return CONTROLLER;  "controller" return CONTROLLER;
# Line 238  ID       [a-zA-Z0-9_]* Line 242  ID       [a-zA-Z0-9_]*
242  "polyphonic" return POLYPHONIC;  "polyphonic" return POLYPHONIC;
243  "mod" return MOD;  "mod" return MOD;
244    
245  on|end|note|init|declare|if|then|begin|end|procedure|function {  [&,()[\]<>=*+#/-] {
246      printf("A keyword: %s\n", yytext);      return *yytext;
247  }  }
248    
249  [&,()[\]<>=*+#/-] { return *yytext; }  ("$"|"@"|"%"){ID} {
   
 ("$"|"@"){ID} {  
     yylval->sValue = strdup(yytext);  
     return VARIABLE;  
 }  
   
 "%"{ID} {  
250      yylval->sValue = strdup(yytext);      yylval->sValue = strdup(yytext);
251      return VARIABLE;      return VARIABLE;
252  }  }
# Line 274  on|end|note|init|declare|if|then|begin|e Line 271  on|end|note|init|declare|if|then|begin|e
271    
272  [ \t\r]+ /* eat up whitespace */  [ \t\r]+ /* eat up whitespace */
273    
274  "..." /* eat up */  . printf( "Unrecognized character: '%s' (line %d, column %d\n", yytext, yylineno, yycolumn);
   
 . printf( "Unrecognized character: %s\n", yytext );  
275    
276  %%  %%
277    

Legend:
Removed from v.2889  
changed lines
  Added in v.2935

  ViewVC Help
Powered by ViewVC