This project is read-only.
1

Closed

define / endless loop

description

  • cs.g was failing on this code:
     
                foreach (Option define in Defines) {
     
    my solution was to unmark define / undef as special tokens.
     
  • cs.g could get into an endless loop. my solution was to remove empty option from PREPROCESSOR_DIRECTIVE
     
    diff below:
     
     
    --- a/CSharpTranslator/antlr3/src/cs2j/CSharp/cs.g
    +++ b/CSharpTranslator/antlr3/src/cs2j/CSharp/cs.g
    @@ -1070,8 +1070,8 @@ ENUM : 'enum';
    IF: 'if';
    ELIF: 'elif';
    ENDIF: 'endif';
    -DEFINE: 'define';
    -UNDEF: 'undef';
    +//DEFINE: 'define';
    +//UNDEF: 'undef';
    SEMI: ';';
    RPAREN: ')';
@@ -1145,7 +1145,7 @@ Pragma:
    '#' TS* ('pragma' | 'region' | 'endregion' | 'line' | 'warning' | 'error') ~('\n'|'\r')*  ('\r' | '\n')+
 { Skip(); } ;
PREPROCESSOR_DIRECTIVE:
  • | PP_CONDITIONAL;
  • PP_CONDITIONAL;
    fragment
    PP_CONDITIONAL:
    (IF_TOKEN
Closed Nov 5, 2010 at 4:19 PM by anbrad
Fixed

comments