Changeset 2141

Show
Ignore:
Timestamp:
06/30/08 16:02:07 (4 months ago)
Author:
sukyoungryu
Message:

[parser] Added better error messages for component/API definitions missing the 'end' keyword.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ProjectFortress/src/com/sun/fortress/parser/Compilation.rats

    r2101 r2141  
    109109       else 
    110110           yyValue = new Component(span, true, a2, a3, a4, a5); 
     111     } 
     112   / <ErrorProduction3> 
     113     (native w)? component w APIName (w Imports w semicolon?)? w 
     114     Exports w semicolon? (w Decls w semicolon?)? w 
     115     { yyValue = syntaxError(createSpan(yyStart,yyCount), 
     116                             "The \"end\" keyword is missing from a component definition."); 
    111117     }; 
    112118 
    113119/* Api ::= api w APIName (w Imports w ;?)? (w AbsDecls w ;?)? w end */ 
    114120private Api Api = 
    115      <ErrorProduction
     121     <ErrorProduction1
    116122     native w api w APIName (w Imports w semicolon?)? 
    117123     (w AbsDecls w semicolon?)? w end 
     
    125131       Span span = createSpan(yyStart,yyCount); 
    126132       yyValue = new Api(span, a1, a2, a3); 
     133     } 
     134   / <ErrorProduction2> 
     135     api w APIName (w Imports w semicolon?)? (w AbsDecls w semicolon?)? w 
     136     { yyValue = syntaxError(createSpan(yyStart,yyCount), 
     137                             "The \"end\" keyword is missing from an API definition."); 
    127138     }; 
    128139