eclipse plugin: update the wml grammar (not fully working yet)
This commit is contained in:
parent
a275e9c784
commit
2bf4894b61
1 changed files with 9 additions and 9 deletions
|
@ -1,16 +1,16 @@
|
|||
/**
|
||||
* @author Timotei Dolean
|
||||
*/
|
||||
grammar org.wesnoth.WML hidden(WS,SL_COMMENT)
|
||||
grammar org.wesnoth.WML hidden(WS, SL_COMMENT)
|
||||
|
||||
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
|
||||
|
||||
generate wML "http://www.wesnoth.org/WML"
|
||||
|
||||
Root:
|
||||
textdomains += TextDomain*
|
||||
& preproc += Preprocessor*
|
||||
& roots += RootType*
|
||||
textdomains += TextDomain*
|
||||
preproc += Preprocessor*
|
||||
roots += RootType*
|
||||
;
|
||||
|
||||
TextDomain:
|
||||
|
@ -19,15 +19,15 @@ TextDomain:
|
|||
Preprocessor:
|
||||
Macro | PathInclude;
|
||||
Macro:
|
||||
'{' macroName = ID '}';
|
||||
'{' macroContent += ID+'}';
|
||||
PathInclude:
|
||||
'{' path = (HOMEPATH |PATH) '}';
|
||||
|
||||
RootType:
|
||||
'[' startTag = RootTag ']'
|
||||
subTypes += RootType*
|
||||
& at += Attributes*
|
||||
& okpreproc += Preprocessor*
|
||||
at += Attributes*
|
||||
okpreproc += Preprocessor*
|
||||
'[' '/' endTag = RootTag ']';
|
||||
|
||||
RootTag:
|
||||
|
@ -41,7 +41,7 @@ RootTagsList:
|
|||
ID; //'about' | 'binary_path' | 'campaign' | 'textdomain' | 'units';
|
||||
|
||||
Attributes:
|
||||
attrName=ID '=' attrValue=(ID|IDLIST|TSTRING|STRING|PATH);
|
||||
attrName=ID '=' attrValue=(TSTRING|STRING|PATH|ID|IDLIST);
|
||||
|
||||
// translatable string
|
||||
TSTRING:
|
||||
|
@ -53,7 +53,7 @@ terminal SL_COMMENT: '#' !('\n'|'\r')* ('\r'? '\n')?;
|
|||
terminal WS : (' '|'\t'|'\r'|'\n')+;
|
||||
// no multiline comment defined on WML,
|
||||
// terminal ML_COMMENT: '#' !('\n'|'\r')* ('\r'? '\n')?;
|
||||
terminal ID : ('a'..'z'|'A'..'Z'|'_'|'-'|'0'..'9')+;
|
||||
terminal ID : ('a'..'z'|'A'..'Z'|'_'|'-'|' '|'0'..'9')+;
|
||||
terminal IDLIST : (ID ',')* ID;
|
||||
//terminal INT returns ecore::EInt: ('0'..'9')+;
|
||||
terminal STRING :
|
||||
|
|
Loading…
Add table
Reference in a new issue