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

Diff of /linuxsampler/trunk/src/scriptvm/editor/nksp.l

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

revision 2951 by schoenebeck, Fri Jul 15 20:07:47 2016 UTC revision 3308 by schoenebeck, Sat Jul 15 01:14:20 2017 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (c) 2015-2016 Christian Schoenebeck   * Copyright (c) 2015-2017 Christian Schoenebeck
3   *   *
4   * http://www.linuxsampler.org   * http://www.linuxsampler.org
5   *   *
# Line 42  static int countNewLineChars(const char* Line 42  static int countNewLineChars(const char*
42      return n;      return n;
43  }  }
44    
45    // shut up warning that 'register' keyword is deprecated as of C++11
46    #if defined(__cplusplus) && __cplusplus >= 201103L
47    # define register
48    #endif
49    
50    // if compiled for debugging, throw an exception instead of exiting on fatal
51    // lexer errors (so the debugger may pause with the appropriate back trace)
52    #if DEBUG
53    # include <stdexcept>
54    # define YY_FATAL_ERROR(msg) throw std::runtime_error(msg)
55    #endif
56    
57  %}  %}
58    
59  /* generate a reentrant safe scanner */  /* generate a reentrant safe scanner */
# Line 60  static int countNewLineChars(const char* Line 72  static int countNewLineChars(const char*
72    
73  DIGIT    [0-9]  DIGIT    [0-9]
74  ID       [a-zA-Z0-9_]+  ID       [a-zA-Z0-9_]+
75    END_ID   on|while|if|select|function|synchronized
76    
77  %%  %%
78    
# Line 214  end { Line 227  end {
227      return yyextra->token.baseType;      return yyextra->token.baseType;
228  }  }
229    
230  <PREPROC_END_NAME>[ \t]*{ID} {  <PREPROC_END_NAME>[ \t]*{END_ID}? {
231      yy_pop_state(yyscanner);      yy_pop_state(yyscanner);
232      yyextra->token = KeywordToken(yytext);      yyextra->token = KeywordToken(yytext);
233      return yyextra->token.baseType;      return yyextra->token.baseType;
# Line 225  end { Line 238  end {
238      return yyextra->token.baseType;      return yyextra->token.baseType;
239  }  }
240    
241  declare|while|if|or|and|not|else|case|select|to|mod|const|polyphonic|function|call {  declare|while|if|or|and|not|else|case|select|to|mod|const|polyphonic|function|call|synchronized {
242      yyextra->token = KeywordToken(yytext);      yyextra->token = KeywordToken(yytext);
243      return yyextra->token.baseType;      return yyextra->token.baseType;
244  }  }

Legend:
Removed from v.2951  
changed lines
  Added in v.3308

  ViewVC Help
Powered by ViewVC