eclipse plugin: update the WML grammar

Added support for preprocessor constructs.

This still doesn't handle some of WML constructs like:

1) {name}=value - attributes that have a macro key name

2) incomplete tag definitions:

\#define MACRO
 [tag]
\#enddef
\#define MACRO_END
 [/tag]
\#enddef
This commit is contained in:
Timotei Dolean 2010-08-16 09:11:12 +00:00
parent 4758da9ed4
commit ed35f3f880
36 changed files with 10797 additions and 2931 deletions

View file

@ -29,6 +29,9 @@ public class AbstractWMLProposalProvider extends AbstractJavaBasedContentProposa
public void completeWMLRoot_Textdomains(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeWMLRoot_IfDefs(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeWMLTag_Plus(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
@ -50,6 +53,9 @@ public class AbstractWMLProposalProvider extends AbstractJavaBasedContentProposa
public void completeWMLTag_Textdomains(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeWMLTag_IfDefs(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeWMLTag_EndName(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
@ -59,6 +65,9 @@ public class AbstractWMLProposalProvider extends AbstractJavaBasedContentProposa
public void completeWMLKey_Value(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeWMLMacroCall_Point(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
public void completeWMLMacroCall_Relative(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
@ -99,6 +108,39 @@ public class AbstractWMLProposalProvider extends AbstractJavaBasedContentProposa
public void completeWMLMacroDefine_Values(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeWMLMacroDefine_IfDefs(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeWMLPreprocIF_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(0)), context, acceptor);
completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(1)), context, acceptor);
completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(2)), context, acceptor);
completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(3)), context, acceptor);
}
public void completeWMLPreprocIF_Tags(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeWMLPreprocIF_Keys(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeWMLPreprocIF_MacroCalls(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeWMLPreprocIF_MacroDefines(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeWMLPreprocIF_Textdomains(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeWMLPreprocIF_Values(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeWMLPreprocIF_IfDefs(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeWMLPreprocIF_Elses(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeWMLTextdomain_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
@ -111,7 +153,9 @@ public class AbstractWMLProposalProvider extends AbstractJavaBasedContentProposa
// subclasses may override
// subclasses may override
// subclasses may override
completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(8)), context, acceptor);
// subclasses may override
// subclasses may override
completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(10)), context, acceptor);
}
public void completeMacroTokens_Val(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
@ -145,6 +189,9 @@ public class AbstractWMLProposalProvider extends AbstractJavaBasedContentProposa
public void complete_WMLMacroDefine(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
public void complete_WMLPreprocIF(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
public void complete_WMLTextdomain(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
@ -163,6 +210,24 @@ public class AbstractWMLProposalProvider extends AbstractJavaBasedContentProposa
public void complete_LUA_CODE(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
public void complete_IFHAVE(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
public void complete_IFNHAVE(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
public void complete_IFDEF(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
public void complete_IFNDEF(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
public void complete_ELSE(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
public void complete_ENDIF(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
public void complete_DEFINE(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}

View file

@ -44,19 +44,24 @@ public class WMLParser extends AbstractContentAssistParser {
put(grammarAccess.getWMLMacroCallAccess().getAlternatives_4(), "rule__WMLMacroCall__Alternatives_4");
put(grammarAccess.getWMLMacroCallAccess().getParamsAlternatives_4_0_0(), "rule__WMLMacroCall__ParamsAlternatives_4_0_0");
put(grammarAccess.getWMLMacroDefineAccess().getAlternatives_1(), "rule__WMLMacroDefine__Alternatives_1");
put(grammarAccess.getWMLPreprocIFAccess().getNameAlternatives_0_0(), "rule__WMLPreprocIF__NameAlternatives_0_0");
put(grammarAccess.getWMLPreprocIFAccess().getAlternatives_1(), "rule__WMLPreprocIF__Alternatives_1");
put(grammarAccess.getWMLValueAccess().getValueAlternatives_0(), "rule__WMLValue__ValueAlternatives_0");
put(grammarAccess.getMacroTokensAccess().getValAlternatives_0(), "rule__MacroTokens__ValAlternatives_0");
put(grammarAccess.getWMLTagAccess().getGroup(), "rule__WMLTag__Group__0");
put(grammarAccess.getWMLKeyAccess().getGroup(), "rule__WMLKey__Group__0");
put(grammarAccess.getWMLKeyAccess().getGroup_3(), "rule__WMLKey__Group_3__0");
put(grammarAccess.getWMLMacroCallAccess().getGroup(), "rule__WMLMacroCall__Group__0");
put(grammarAccess.getWMLMacroCallAccess().getGroup_1(), "rule__WMLMacroCall__Group_1__0");
put(grammarAccess.getWMLArrayCallAccess().getGroup(), "rule__WMLArrayCall__Group__0");
put(grammarAccess.getWMLMacroDefineAccess().getGroup(), "rule__WMLMacroDefine__Group__0");
put(grammarAccess.getWMLPreprocIFAccess().getGroup(), "rule__WMLPreprocIF__Group__0");
put(grammarAccess.getTSTRINGAccess().getGroup(), "rule__TSTRING__Group__0");
put(grammarAccess.getWMLRootAccess().getTagsAssignment_0(), "rule__WMLRoot__TagsAssignment_0");
put(grammarAccess.getWMLRootAccess().getMacroCallsAssignment_1(), "rule__WMLRoot__MacroCallsAssignment_1");
put(grammarAccess.getWMLRootAccess().getMacroDefinesAssignment_2(), "rule__WMLRoot__MacroDefinesAssignment_2");
put(grammarAccess.getWMLRootAccess().getTextdomainsAssignment_3(), "rule__WMLRoot__TextdomainsAssignment_3");
put(grammarAccess.getWMLRootAccess().getIfDefsAssignment_4(), "rule__WMLRoot__IfDefsAssignment_4");
put(grammarAccess.getWMLTagAccess().getPlusAssignment_1(), "rule__WMLTag__PlusAssignment_1");
put(grammarAccess.getWMLTagAccess().getNameAssignment_2(), "rule__WMLTag__NameAssignment_2");
put(grammarAccess.getWMLTagAccess().getTagsAssignment_4_0(), "rule__WMLTag__TagsAssignment_4_0");
@ -64,10 +69,12 @@ public class WMLParser extends AbstractContentAssistParser {
put(grammarAccess.getWMLTagAccess().getMacroCallsAssignment_4_2(), "rule__WMLTag__MacroCallsAssignment_4_2");
put(grammarAccess.getWMLTagAccess().getMacroDefinesAssignment_4_3(), "rule__WMLTag__MacroDefinesAssignment_4_3");
put(grammarAccess.getWMLTagAccess().getTextdomainsAssignment_4_4(), "rule__WMLTag__TextdomainsAssignment_4_4");
put(grammarAccess.getWMLTagAccess().getIfDefsAssignment_4_5(), "rule__WMLTag__IfDefsAssignment_4_5");
put(grammarAccess.getWMLTagAccess().getEndNameAssignment_6(), "rule__WMLTag__EndNameAssignment_6");
put(grammarAccess.getWMLKeyAccess().getNameAssignment_0(), "rule__WMLKey__NameAssignment_0");
put(grammarAccess.getWMLKeyAccess().getValueAssignment_2(), "rule__WMLKey__ValueAssignment_2");
put(grammarAccess.getWMLKeyAccess().getValueAssignment_3_3(), "rule__WMLKey__ValueAssignment_3_3");
put(grammarAccess.getWMLMacroCallAccess().getPointAssignment_1_0(), "rule__WMLMacroCall__PointAssignment_1_0");
put(grammarAccess.getWMLMacroCallAccess().getRelativeAssignment_2(), "rule__WMLMacroCall__RelativeAssignment_2");
put(grammarAccess.getWMLMacroCallAccess().getNameAssignment_3(), "rule__WMLMacroCall__NameAssignment_3");
put(grammarAccess.getWMLMacroCallAccess().getParamsAssignment_4_0(), "rule__WMLMacroCall__ParamsAssignment_4_0");
@ -81,6 +88,16 @@ public class WMLParser extends AbstractContentAssistParser {
put(grammarAccess.getWMLMacroDefineAccess().getMacroDefinesAssignment_1_3(), "rule__WMLMacroDefine__MacroDefinesAssignment_1_3");
put(grammarAccess.getWMLMacroDefineAccess().getTextdomainsAssignment_1_4(), "rule__WMLMacroDefine__TextdomainsAssignment_1_4");
put(grammarAccess.getWMLMacroDefineAccess().getValuesAssignment_1_5(), "rule__WMLMacroDefine__ValuesAssignment_1_5");
put(grammarAccess.getWMLMacroDefineAccess().getIfDefsAssignment_1_6(), "rule__WMLMacroDefine__IfDefsAssignment_1_6");
put(grammarAccess.getWMLPreprocIFAccess().getNameAssignment_0(), "rule__WMLPreprocIF__NameAssignment_0");
put(grammarAccess.getWMLPreprocIFAccess().getTagsAssignment_1_0(), "rule__WMLPreprocIF__TagsAssignment_1_0");
put(grammarAccess.getWMLPreprocIFAccess().getKeysAssignment_1_1(), "rule__WMLPreprocIF__KeysAssignment_1_1");
put(grammarAccess.getWMLPreprocIFAccess().getMacroCallsAssignment_1_2(), "rule__WMLPreprocIF__MacroCallsAssignment_1_2");
put(grammarAccess.getWMLPreprocIFAccess().getMacroDefinesAssignment_1_3(), "rule__WMLPreprocIF__MacroDefinesAssignment_1_3");
put(grammarAccess.getWMLPreprocIFAccess().getTextdomainsAssignment_1_4(), "rule__WMLPreprocIF__TextdomainsAssignment_1_4");
put(grammarAccess.getWMLPreprocIFAccess().getValuesAssignment_1_5(), "rule__WMLPreprocIF__ValuesAssignment_1_5");
put(grammarAccess.getWMLPreprocIFAccess().getIfDefsAssignment_1_6(), "rule__WMLPreprocIF__IfDefsAssignment_1_6");
put(grammarAccess.getWMLPreprocIFAccess().getElsesAssignment_1_7(), "rule__WMLPreprocIF__ElsesAssignment_1_7");
put(grammarAccess.getWMLTextdomainAccess().getNameAssignment(), "rule__WMLTextdomain__NameAssignment");
put(grammarAccess.getWMLValueAccess().getValueAssignment(), "rule__WMLValue__ValueAssignment");
put(grammarAccess.getMacroTokensAccess().getValAssignment(), "rule__MacroTokens__ValAssignment");

View file

@ -289,6 +289,34 @@ finally {
// Entry rule entryRuleWMLPreprocIF
entryRuleWMLPreprocIF
:
{ before(grammarAccess.getWMLPreprocIFRule()); }
ruleWMLPreprocIF
{ after(grammarAccess.getWMLPreprocIFRule()); }
EOF
;
// Rule WMLPreprocIF
ruleWMLPreprocIF
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLPreprocIFAccess().getGroup()); }
(rule__WMLPreprocIF__Group__0)
{ after(grammarAccess.getWMLPreprocIFAccess().getGroup()); }
)
;
finally {
restoreStackSize(stackSize);
}
// Entry rule entryRuleWMLTextdomain
entryRuleWMLTextdomain
:
@ -459,6 +487,12 @@ rule__WMLRoot__Alternatives
{ before(grammarAccess.getWMLRootAccess().getTextdomainsAssignment_3()); }
(rule__WMLRoot__TextdomainsAssignment_3)
{ after(grammarAccess.getWMLRootAccess().getTextdomainsAssignment_3()); }
)
|(
{ before(grammarAccess.getWMLRootAccess().getIfDefsAssignment_4()); }
(rule__WMLRoot__IfDefsAssignment_4)
{ after(grammarAccess.getWMLRootAccess().getIfDefsAssignment_4()); }
)
;
@ -499,6 +533,12 @@ rule__WMLTag__Alternatives_4
{ before(grammarAccess.getWMLTagAccess().getTextdomainsAssignment_4_4()); }
(rule__WMLTag__TextdomainsAssignment_4_4)
{ after(grammarAccess.getWMLTagAccess().getTextdomainsAssignment_4_4()); }
)
|(
{ before(grammarAccess.getWMLTagAccess().getIfDefsAssignment_4_5()); }
(rule__WMLTag__IfDefsAssignment_4_5)
{ after(grammarAccess.getWMLTagAccess().getIfDefsAssignment_4_5()); }
)
;
@ -645,6 +685,104 @@ rule__WMLMacroDefine__Alternatives_1
{ before(grammarAccess.getWMLMacroDefineAccess().getValuesAssignment_1_5()); }
(rule__WMLMacroDefine__ValuesAssignment_1_5)
{ after(grammarAccess.getWMLMacroDefineAccess().getValuesAssignment_1_5()); }
)
|(
{ before(grammarAccess.getWMLMacroDefineAccess().getIfDefsAssignment_1_6()); }
(rule__WMLMacroDefine__IfDefsAssignment_1_6)
{ after(grammarAccess.getWMLMacroDefineAccess().getIfDefsAssignment_1_6()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLPreprocIF__NameAlternatives_0_0
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLPreprocIFAccess().getNameIFDEFTerminalRuleCall_0_0_0()); }
RULE_IFDEF
{ after(grammarAccess.getWMLPreprocIFAccess().getNameIFDEFTerminalRuleCall_0_0_0()); }
)
|(
{ before(grammarAccess.getWMLPreprocIFAccess().getNameIFNDEFTerminalRuleCall_0_0_1()); }
RULE_IFNDEF
{ after(grammarAccess.getWMLPreprocIFAccess().getNameIFNDEFTerminalRuleCall_0_0_1()); }
)
|(
{ before(grammarAccess.getWMLPreprocIFAccess().getNameIFHAVETerminalRuleCall_0_0_2()); }
RULE_IFHAVE
{ after(grammarAccess.getWMLPreprocIFAccess().getNameIFHAVETerminalRuleCall_0_0_2()); }
)
|(
{ before(grammarAccess.getWMLPreprocIFAccess().getNameIFNHAVETerminalRuleCall_0_0_3()); }
RULE_IFNHAVE
{ after(grammarAccess.getWMLPreprocIFAccess().getNameIFNHAVETerminalRuleCall_0_0_3()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLPreprocIF__Alternatives_1
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLPreprocIFAccess().getTagsAssignment_1_0()); }
(rule__WMLPreprocIF__TagsAssignment_1_0)
{ after(grammarAccess.getWMLPreprocIFAccess().getTagsAssignment_1_0()); }
)
|(
{ before(grammarAccess.getWMLPreprocIFAccess().getKeysAssignment_1_1()); }
(rule__WMLPreprocIF__KeysAssignment_1_1)
{ after(grammarAccess.getWMLPreprocIFAccess().getKeysAssignment_1_1()); }
)
|(
{ before(grammarAccess.getWMLPreprocIFAccess().getMacroCallsAssignment_1_2()); }
(rule__WMLPreprocIF__MacroCallsAssignment_1_2)
{ after(grammarAccess.getWMLPreprocIFAccess().getMacroCallsAssignment_1_2()); }
)
|(
{ before(grammarAccess.getWMLPreprocIFAccess().getMacroDefinesAssignment_1_3()); }
(rule__WMLPreprocIF__MacroDefinesAssignment_1_3)
{ after(grammarAccess.getWMLPreprocIFAccess().getMacroDefinesAssignment_1_3()); }
)
|(
{ before(grammarAccess.getWMLPreprocIFAccess().getTextdomainsAssignment_1_4()); }
(rule__WMLPreprocIF__TextdomainsAssignment_1_4)
{ after(grammarAccess.getWMLPreprocIFAccess().getTextdomainsAssignment_1_4()); }
)
|(
{ before(grammarAccess.getWMLPreprocIFAccess().getValuesAssignment_1_5()); }
(rule__WMLPreprocIF__ValuesAssignment_1_5)
{ after(grammarAccess.getWMLPreprocIFAccess().getValuesAssignment_1_5()); }
)
|(
{ before(grammarAccess.getWMLPreprocIFAccess().getIfDefsAssignment_1_6()); }
(rule__WMLPreprocIF__IfDefsAssignment_1_6)
{ after(grammarAccess.getWMLPreprocIFAccess().getIfDefsAssignment_1_6()); }
)
|(
{ before(grammarAccess.getWMLPreprocIFAccess().getElsesAssignment_1_7()); }
(rule__WMLPreprocIF__ElsesAssignment_1_7)
{ after(grammarAccess.getWMLPreprocIFAccess().getElsesAssignment_1_7()); }
)
;
@ -698,25 +836,41 @@ rule__WMLValue__ValueAlternatives_0
)
|(
{ before(grammarAccess.getWMLValueAccess().getValueLeftParenthesisKeyword_0_6()); }
{ before(grammarAccess.getWMLValueAccess().getValueDollarSignKeyword_0_6()); }
'$'
{ after(grammarAccess.getWMLValueAccess().getValueDollarSignKeyword_0_6()); }
)
|(
{ before(grammarAccess.getWMLValueAccess().getValueSolidusKeyword_0_7()); }
'/'
{ after(grammarAccess.getWMLValueAccess().getValueSolidusKeyword_0_7()); }
)
|(
{ before(grammarAccess.getWMLValueAccess().getValueLeftParenthesisKeyword_0_8()); }
'('
{ after(grammarAccess.getWMLValueAccess().getValueLeftParenthesisKeyword_0_6()); }
{ after(grammarAccess.getWMLValueAccess().getValueLeftParenthesisKeyword_0_8()); }
)
|(
{ before(grammarAccess.getWMLValueAccess().getValueRightParenthesisKeyword_0_7()); }
{ before(grammarAccess.getWMLValueAccess().getValueRightParenthesisKeyword_0_9()); }
')'
{ after(grammarAccess.getWMLValueAccess().getValueRightParenthesisKeyword_0_7()); }
{ after(grammarAccess.getWMLValueAccess().getValueRightParenthesisKeyword_0_9()); }
)
|(
{ before(grammarAccess.getWMLValueAccess().getValueANY_OTHERTerminalRuleCall_0_8()); }
{ before(grammarAccess.getWMLValueAccess().getValueANY_OTHERTerminalRuleCall_0_10()); }
RULE_ANY_OTHER
{ after(grammarAccess.getWMLValueAccess().getValueANY_OTHERTerminalRuleCall_0_8()); }
{ after(grammarAccess.getWMLValueAccess().getValueANY_OTHERTerminalRuleCall_0_10()); }
)
;
@ -1293,10 +1447,17 @@ rule__WMLKey__Group_3__3__Impl
}
:
(
(
{ before(grammarAccess.getWMLKeyAccess().getValueAssignment_3_3()); }
(rule__WMLKey__ValueAssignment_3_3)
{ after(grammarAccess.getWMLKeyAccess().getValueAssignment_3_3()); }
)
(
{ before(grammarAccess.getWMLKeyAccess().getValueAssignment_3_3()); }
(rule__WMLKey__ValueAssignment_3_3)*
{ after(grammarAccess.getWMLKeyAccess().getValueAssignment_3_3()); }
)
)
;
finally {
@ -1361,11 +1522,9 @@ rule__WMLMacroCall__Group__1__Impl
}
:
(
{ before(grammarAccess.getWMLMacroCallAccess().getFullStopSolidusKeyword_1()); }
(
'./'
)?
{ after(grammarAccess.getWMLMacroCallAccess().getFullStopSolidusKeyword_1()); }
{ before(grammarAccess.getWMLMacroCallAccess().getGroup_1()); }
(rule__WMLMacroCall__Group_1__0)?
{ after(grammarAccess.getWMLMacroCallAccess().getGroup_1()); }
)
;
@ -1503,6 +1662,69 @@ finally {
rule__WMLMacroCall__Group_1__0
@init {
int stackSize = keepStackSize();
}
:
rule__WMLMacroCall__Group_1__0__Impl
rule__WMLMacroCall__Group_1__1
;
finally {
restoreStackSize(stackSize);
}
rule__WMLMacroCall__Group_1__0__Impl
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLMacroCallAccess().getPointAssignment_1_0()); }
(rule__WMLMacroCall__PointAssignment_1_0)
{ after(grammarAccess.getWMLMacroCallAccess().getPointAssignment_1_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLMacroCall__Group_1__1
@init {
int stackSize = keepStackSize();
}
:
rule__WMLMacroCall__Group_1__1__Impl
;
finally {
restoreStackSize(stackSize);
}
rule__WMLMacroCall__Group_1__1__Impl
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLMacroCallAccess().getSolidusKeyword_1_1()); }
'/'
{ after(grammarAccess.getWMLMacroCallAccess().getSolidusKeyword_1_1()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLArrayCall__Group__0
@init {
int stackSize = keepStackSize();
@ -1698,6 +1920,98 @@ finally {
rule__WMLPreprocIF__Group__0
@init {
int stackSize = keepStackSize();
}
:
rule__WMLPreprocIF__Group__0__Impl
rule__WMLPreprocIF__Group__1
;
finally {
restoreStackSize(stackSize);
}
rule__WMLPreprocIF__Group__0__Impl
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLPreprocIFAccess().getNameAssignment_0()); }
(rule__WMLPreprocIF__NameAssignment_0)
{ after(grammarAccess.getWMLPreprocIFAccess().getNameAssignment_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLPreprocIF__Group__1
@init {
int stackSize = keepStackSize();
}
:
rule__WMLPreprocIF__Group__1__Impl
rule__WMLPreprocIF__Group__2
;
finally {
restoreStackSize(stackSize);
}
rule__WMLPreprocIF__Group__1__Impl
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLPreprocIFAccess().getAlternatives_1()); }
(rule__WMLPreprocIF__Alternatives_1)*
{ after(grammarAccess.getWMLPreprocIFAccess().getAlternatives_1()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLPreprocIF__Group__2
@init {
int stackSize = keepStackSize();
}
:
rule__WMLPreprocIF__Group__2__Impl
;
finally {
restoreStackSize(stackSize);
}
rule__WMLPreprocIF__Group__2__Impl
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLPreprocIFAccess().getENDIFTerminalRuleCall_2()); }
RULE_ENDIF
{ after(grammarAccess.getWMLPreprocIFAccess().getENDIFTerminalRuleCall_2()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__TSTRING__Group__0
@init {
int stackSize = keepStackSize();
@ -1822,6 +2136,21 @@ finally {
restoreStackSize(stackSize);
}
rule__WMLRoot__IfDefsAssignment_4
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLRootAccess().getIfDefsWMLPreprocIFParserRuleCall_4_0()); }
ruleWMLPreprocIF{ after(grammarAccess.getWMLRootAccess().getIfDefsWMLPreprocIFParserRuleCall_4_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLTag__PlusAssignment_1
@init {
int stackSize = keepStackSize();
@ -1935,6 +2264,21 @@ finally {
restoreStackSize(stackSize);
}
rule__WMLTag__IfDefsAssignment_4_5
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLTagAccess().getIfDefsWMLPreprocIFParserRuleCall_4_5_0()); }
ruleWMLPreprocIF{ after(grammarAccess.getWMLTagAccess().getIfDefsWMLPreprocIFParserRuleCall_4_5_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLTag__EndNameAssignment_6
@init {
int stackSize = keepStackSize();
@ -1995,6 +2339,29 @@ finally {
restoreStackSize(stackSize);
}
rule__WMLMacroCall__PointAssignment_1_0
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLMacroCallAccess().getPointFullStopKeyword_1_0_0()); }
(
{ before(grammarAccess.getWMLMacroCallAccess().getPointFullStopKeyword_1_0_0()); }
'.'
{ after(grammarAccess.getWMLMacroCallAccess().getPointFullStopKeyword_1_0_0()); }
)
{ after(grammarAccess.getWMLMacroCallAccess().getPointFullStopKeyword_1_0_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLMacroCall__RelativeAssignment_2
@init {
int stackSize = keepStackSize();
@ -2199,6 +2566,157 @@ finally {
restoreStackSize(stackSize);
}
rule__WMLMacroDefine__IfDefsAssignment_1_6
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLMacroDefineAccess().getIfDefsWMLPreprocIFParserRuleCall_1_6_0()); }
ruleWMLPreprocIF{ after(grammarAccess.getWMLMacroDefineAccess().getIfDefsWMLPreprocIFParserRuleCall_1_6_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLPreprocIF__NameAssignment_0
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLPreprocIFAccess().getNameAlternatives_0_0()); }
(rule__WMLPreprocIF__NameAlternatives_0_0)
{ after(grammarAccess.getWMLPreprocIFAccess().getNameAlternatives_0_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLPreprocIF__TagsAssignment_1_0
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLPreprocIFAccess().getTagsWMLTagParserRuleCall_1_0_0()); }
ruleWMLTag{ after(grammarAccess.getWMLPreprocIFAccess().getTagsWMLTagParserRuleCall_1_0_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLPreprocIF__KeysAssignment_1_1
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLPreprocIFAccess().getKeysWMLKeyParserRuleCall_1_1_0()); }
ruleWMLKey{ after(grammarAccess.getWMLPreprocIFAccess().getKeysWMLKeyParserRuleCall_1_1_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLPreprocIF__MacroCallsAssignment_1_2
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLPreprocIFAccess().getMacroCallsWMLMacroCallParserRuleCall_1_2_0()); }
ruleWMLMacroCall{ after(grammarAccess.getWMLPreprocIFAccess().getMacroCallsWMLMacroCallParserRuleCall_1_2_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLPreprocIF__MacroDefinesAssignment_1_3
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLPreprocIFAccess().getMacroDefinesWMLMacroDefineParserRuleCall_1_3_0()); }
ruleWMLMacroDefine{ after(grammarAccess.getWMLPreprocIFAccess().getMacroDefinesWMLMacroDefineParserRuleCall_1_3_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLPreprocIF__TextdomainsAssignment_1_4
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLPreprocIFAccess().getTextdomainsWMLTextdomainParserRuleCall_1_4_0()); }
ruleWMLTextdomain{ after(grammarAccess.getWMLPreprocIFAccess().getTextdomainsWMLTextdomainParserRuleCall_1_4_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLPreprocIF__ValuesAssignment_1_5
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLPreprocIFAccess().getValuesWMLValueParserRuleCall_1_5_0()); }
ruleWMLValue{ after(grammarAccess.getWMLPreprocIFAccess().getValuesWMLValueParserRuleCall_1_5_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLPreprocIF__IfDefsAssignment_1_6
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLPreprocIFAccess().getIfDefsWMLPreprocIFParserRuleCall_1_6_0()); }
ruleWMLPreprocIF{ after(grammarAccess.getWMLPreprocIFAccess().getIfDefsWMLPreprocIFParserRuleCall_1_6_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLPreprocIF__ElsesAssignment_1_7
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getWMLPreprocIFAccess().getElsesELSETerminalRuleCall_1_7_0()); }
RULE_ELSE{ after(grammarAccess.getWMLPreprocIFAccess().getElsesELSETerminalRuleCall_1_7_0()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__WMLTextdomain__NameAssignment
@init {
int stackSize = keepStackSize();
@ -2249,6 +2767,18 @@ finally {
RULE_LUA_CODE : '<<' ( options {greedy=false;} : . )*'>>';
RULE_IFHAVE : '#ifhave' ~(('\n'|'\r'))* ('\r'? '\n')?;
RULE_IFNHAVE : '#ifnhave' ~(('\n'|'\r'))* ('\r'? '\n')?;
RULE_IFDEF : '#ifdef' ~(('\n'|'\r'))* ('\r'? '\n')?;
RULE_IFNDEF : '#ifndef' ~(('\n'|'\r'))* ('\r'? '\n')?;
RULE_ELSE : '#else' ~(('\n'|'\r'))* ('\r'? '\n')?;
RULE_ENDIF : '#endif' ~(('\n'|'\r'))* ('\r'? '\n')?;
RULE_DEFINE : '#define' ~(('\n'|'\r'))* ('\r'? '\n')?;
RULE_ENDDEF : '#enddef' ~(('\n'|'\r'))* ('\r'? '\n')?;

View file

@ -1,24 +1,31 @@
RULE_LUA_CODE=10
RULE_ID=6
RULE_STRING=7
RULE_DEFINE=11
RULE_ANY_OTHER=8
RULE_ENDDEF=9
RULE_LUA_CODE=15
RULE_IFDEF=6
RULE_ID=10
RULE_ANY_OTHER=12
RULE_IFNDEF=7
RULE_EOL=4
RULE_TEXTDOMAIN=12
RULE_WS=13
RULE_TEXTDOMAIN=18
RULE_IFNHAVE=9
RULE_SL_COMMENT=5
'}'=26
'~'=15
'_$'=14
'{'=24
'='=19
'('=17
'['=20
'[/'=23
'+'=22
'_'=27
'.'=16
')'=18
']'=21
'./'=25
RULE_STRING=11
RULE_ENDIF=14
RULE_DEFINE=16
RULE_ENDDEF=13
RULE_IFHAVE=8
RULE_WS=19
RULE_ELSE=17
'$'=23
'}'=33
'~'=21
'/'=24
'_$'=20
'{'=32
'='=27
'('=25
'['=28
'[/'=31
'+'=30
'_'=34
'.'=22
')'=26
']'=29

View file

@ -7,49 +7,68 @@ package org.wesnoth.ui.contentassist.antlr.internal;
import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.Lexer;
}
T14 : '_$' ;
T15 : '~' ;
T16 : '.' ;
T17 : '(' ;
T18 : ')' ;
T19 : '=' ;
T20 : '[' ;
T21 : ']' ;
T22 : '+' ;
T23 : '[/' ;
T24 : '{' ;
T25 : './' ;
T26 : '}' ;
T27 : '_' ;
T20 : '_$' ;
T21 : '~' ;
T22 : '.' ;
T23 : '$' ;
T24 : '/' ;
T25 : '(' ;
T26 : ')' ;
T27 : '=' ;
T28 : '[' ;
T29 : ']' ;
T30 : '+' ;
T31 : '[/' ;
T32 : '{' ;
T33 : '}' ;
T34 : '_' ;
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2250
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2768
RULE_LUA_CODE : '<<' ( options {greedy=false;} : . )*'>>';
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2252
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2770
RULE_IFHAVE : '#ifhave' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2772
RULE_IFNHAVE : '#ifnhave' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2774
RULE_IFDEF : '#ifdef' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2776
RULE_IFNDEF : '#ifndef' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2778
RULE_ELSE : '#else' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2780
RULE_ENDIF : '#endif' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2782
RULE_DEFINE : '#define' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2254
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2784
RULE_ENDDEF : '#enddef' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2256
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2786
RULE_TEXTDOMAIN : '#textdomain' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2258
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2788
RULE_STRING : '"' ('\\' ('b'|'t'|'n'|'f'|'r'|'"'|'\''|'\\')|~(('\\'|'"')))* '"';
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2260
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2790
RULE_ID : ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|'-'|',')+;
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2262
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2792
RULE_EOL : ('\r'|'\n');
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2264
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2794
RULE_WS : (' '|'\t')+;
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2266
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2796
RULE_ANY_OTHER : .;
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2268
// $ANTLR src "../org.wesnoth.wml.ui/src-gen/org/wesnoth/ui/contentassist/antlr/internal/InternalWML.g" 2798
RULE_SL_COMMENT : '#' ~(('\n'|'\r'))* ('\r'? '\n')?;

View file

@ -12,6 +12,8 @@
eType="#//WMLMacroDefine" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="Textdomains" upperBound="-1"
eType="#//WMLTextdomain" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="IfDefs" upperBound="-1"
eType="#//WMLPreprocIF" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="WMLTag">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="plus" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
@ -26,6 +28,8 @@
eType="#//WMLMacroDefine" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="Textdomains" upperBound="-1"
eType="#//WMLTextdomain" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="IfDefs" upperBound="-1"
eType="#//WMLPreprocIF" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="endName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="WMLKey">
@ -35,6 +39,7 @@
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="WMLKeyValue"/>
<eClassifiers xsi:type="ecore:EClass" name="WMLMacroCall" eSuperTypes="#//WMLKeyValue">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="point" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="relative" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="params" upperBound="-1"
@ -63,6 +68,27 @@
eType="#//WMLTextdomain" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="Values" upperBound="-1"
eType="#//WMLValue" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="IfDefs" upperBound="-1"
eType="#//WMLPreprocIF" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="WMLPreprocIF">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="Tags" upperBound="-1" eType="#//WMLTag"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="Keys" upperBound="-1" eType="#//WMLKey"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="MacroCalls" upperBound="-1"
eType="#//WMLMacroCall" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="MacroDefines" upperBound="-1"
eType="#//WMLMacroDefine" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="Textdomains" upperBound="-1"
eType="#//WMLTextdomain" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="Values" upperBound="-1"
eType="#//WMLValue" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="IfDefs" upperBound="-1"
eType="#//WMLPreprocIF" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Elses" unique="false" upperBound="-1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="WMLTextdomain">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>

View file

@ -13,6 +13,7 @@
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLRoot/MacroCalls"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLRoot/MacroDefines"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLRoot/Textdomains"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLRoot/IfDefs"/>
</genClasses>
<genClasses ecoreClass="WML.ecore#//WMLTag">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute WML.ecore#//WMLTag/plus"/>
@ -22,6 +23,7 @@
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLTag/MacroCalls"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLTag/MacroDefines"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLTag/Textdomains"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLTag/IfDefs"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute WML.ecore#//WMLTag/endName"/>
</genClasses>
<genClasses ecoreClass="WML.ecore#//WMLKey">
@ -30,6 +32,7 @@
</genClasses>
<genClasses ecoreClass="WML.ecore#//WMLKeyValue"/>
<genClasses ecoreClass="WML.ecore#//WMLMacroCall">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute WML.ecore#//WMLMacroCall/point"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute WML.ecore#//WMLMacroCall/relative"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute WML.ecore#//WMLMacroCall/name"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLMacroCall/params"/>
@ -49,6 +52,18 @@
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLMacroDefine/MacroDefines"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLMacroDefine/Textdomains"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLMacroDefine/Values"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLMacroDefine/IfDefs"/>
</genClasses>
<genClasses ecoreClass="WML.ecore#//WMLPreprocIF">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute WML.ecore#//WMLPreprocIF/name"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLPreprocIF/Tags"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLPreprocIF/Keys"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLPreprocIF/MacroCalls"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLPreprocIF/MacroDefines"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLPreprocIF/Textdomains"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLPreprocIF/Values"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference WML.ecore#//WMLPreprocIF/IfDefs"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute WML.ecore#//WMLPreprocIF/Elses"/>
</genClasses>
<genClasses ecoreClass="WML.ecore#//WMLTextdomain">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute WML.ecore#//WMLTextdomain/name"/>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ASCII"?>
<xtext:Grammar xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:xtext="http://www.eclipse.org/2008/Xtext" name="org.wesnoth.WML" definesHiddenTokens="true" hiddenTokens="//@rules.19 //@rules.20 //@rules.22">
<xtext:Grammar xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:xtext="http://www.eclipse.org/2008/Xtext" name="org.wesnoth.WML" definesHiddenTokens="true" hiddenTokens="//@rules.26 //@rules.27 //@rules.29">
<metamodelDeclarations xsi:type="xtext:GeneratedMetamodel" name="wML">
<ePackage href="http://www.wesnoth.org/WML#/"/>
</metamodelDeclarations>
@ -21,6 +21,9 @@
<terminal xsi:type="xtext:RuleCall" rule="//@rules.7"/>
</elements>
<elements xsi:type="xtext:Assignment" feature="Textdomains" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.9"/>
</elements>
<elements xsi:type="xtext:Assignment" feature="IfDefs" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.8"/>
</elements>
</alternatives>
@ -35,7 +38,7 @@
<terminal xsi:type="xtext:Keyword" value="+"/>
</elements>
<elements xsi:type="xtext:Assignment" feature="name" operator="=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.18"/>
<terminal xsi:type="xtext:RuleCall" rule="//@rules.25"/>
</elements>
<elements xsi:type="xtext:Keyword" value="]"/>
<elements xsi:type="xtext:Alternatives" cardinality="*">
@ -52,39 +55,42 @@
<terminal xsi:type="xtext:RuleCall" rule="//@rules.7"/>
</elements>
<elements xsi:type="xtext:Assignment" feature="Textdomains" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.9"/>
</elements>
<elements xsi:type="xtext:Assignment" feature="IfDefs" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.8"/>
</elements>
</elements>
<elements xsi:type="xtext:Keyword" value="[/"/>
<elements xsi:type="xtext:Assignment" feature="endName" operator="=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.18"/>
<terminal xsi:type="xtext:RuleCall" rule="//@rules.25"/>
</elements>
<elements xsi:type="xtext:Keyword" value="]"/>
</alternatives>
</rules>
<rules xsi:type="xtext:ParserRule" name="WMLKey" definesHiddenTokens="true" hiddenTokens="//@rules.20">
<rules xsi:type="xtext:ParserRule" name="WMLKey" definesHiddenTokens="true" hiddenTokens="//@rules.27">
<type metamodel="//@metamodelDeclarations.0">
<classifier xsi:type="ecore:EClass" href="http://www.wesnoth.org/WML#//WMLKey"/>
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:Assignment" feature="name" operator="=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.18"/>
<terminal xsi:type="xtext:RuleCall" rule="//@rules.25"/>
</elements>
<elements xsi:type="xtext:Keyword" value="="/>
<elements xsi:type="xtext:Assignment" cardinality="*" feature="value" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.3"/>
</elements>
<elements xsi:type="xtext:Group" cardinality="*">
<elements xsi:type="xtext:RuleCall" cardinality="?" rule="//@rules.19"/>
<elements xsi:type="xtext:RuleCall" cardinality="?" rule="//@rules.26"/>
<elements xsi:type="xtext:Keyword" value="+"/>
<elements xsi:type="xtext:RuleCall" cardinality="?" rule="//@rules.19"/>
<elements xsi:type="xtext:Assignment" feature="value" operator="+=">
<elements xsi:type="xtext:RuleCall" cardinality="?" rule="//@rules.26"/>
<elements xsi:type="xtext:Assignment" cardinality="+" feature="value" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.3"/>
</elements>
</elements>
<elements xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:RuleCall" rule="//@rules.19"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.22"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.26"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.29"/>
</elements>
</alternatives>
</rules>
@ -93,7 +99,7 @@
<classifier xsi:type="ecore:EClass" href="http://www.wesnoth.org/WML#//WMLKeyValue"/>
</type>
<alternatives xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:RuleCall" rule="//@rules.9"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.10"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.4"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.5"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.6"/>
@ -105,18 +111,23 @@
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:Keyword" value="{"/>
<elements xsi:type="xtext:Keyword" cardinality="?" value="./"/>
<elements xsi:type="xtext:Group" cardinality="?">
<elements xsi:type="xtext:Assignment" feature="point" operator="?=">
<terminal xsi:type="xtext:Keyword" value="."/>
</elements>
<elements xsi:type="xtext:Keyword" value="/"/>
</elements>
<elements xsi:type="xtext:Assignment" cardinality="?" feature="relative" operator="?=">
<terminal xsi:type="xtext:Keyword" value="~"/>
</elements>
<elements xsi:type="xtext:Assignment" feature="name" operator="=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.18"/>
<terminal xsi:type="xtext:RuleCall" rule="//@rules.25"/>
</elements>
<elements xsi:type="xtext:Alternatives" cardinality="*">
<elements xsi:type="xtext:Assignment" feature="params" operator="+=">
<terminal xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:RuleCall" rule="//@rules.9"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.12"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.10"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.13"/>
</terminal>
</elements>
<elements xsi:type="xtext:Assignment" feature="extraMacros" operator="+=">
@ -131,7 +142,7 @@
<classifier xsi:type="ecore:EClass" href="http://www.wesnoth.org/WML#//WMLLuaCode"/>
</type>
<alternatives xsi:type="xtext:Assignment" feature="value" operator="=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.13"/>
<terminal xsi:type="xtext:RuleCall" rule="//@rules.14"/>
</alternatives>
</rules>
<rules xsi:type="xtext:ParserRule" name="WMLArrayCall">
@ -141,7 +152,7 @@
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:Keyword" value="["/>
<elements xsi:type="xtext:Assignment" cardinality="+" feature="value" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.9"/>
<terminal xsi:type="xtext:RuleCall" rule="//@rules.10"/>
</elements>
<elements xsi:type="xtext:Keyword" value="]"/>
</alternatives>
@ -152,7 +163,7 @@
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:Assignment" feature="name" operator="=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.14"/>
<terminal xsi:type="xtext:RuleCall" rule="//@rules.21"/>
</elements>
<elements xsi:type="xtext:Alternatives" cardinality="*">
<elements xsi:type="xtext:Assignment" feature="Tags" operator="+=">
@ -168,13 +179,58 @@
<terminal xsi:type="xtext:RuleCall" rule="//@rules.7"/>
</elements>
<elements xsi:type="xtext:Assignment" feature="Textdomains" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.8"/>
</elements>
<elements xsi:type="xtext:Assignment" feature="Values" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.9"/>
</elements>
<elements xsi:type="xtext:Assignment" feature="Values" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.10"/>
</elements>
<elements xsi:type="xtext:Assignment" feature="IfDefs" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.8"/>
</elements>
</elements>
<elements xsi:type="xtext:RuleCall" rule="//@rules.15"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.22"/>
</alternatives>
</rules>
<rules xsi:type="xtext:ParserRule" name="WMLPreprocIF">
<type metamodel="//@metamodelDeclarations.0">
<classifier xsi:type="ecore:EClass" href="http://www.wesnoth.org/WML#//WMLPreprocIF"/>
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:Assignment" feature="name" operator="=">
<terminal xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:RuleCall" rule="//@rules.17"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.18"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.15"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.16"/>
</terminal>
</elements>
<elements xsi:type="xtext:Alternatives" cardinality="*">
<elements xsi:type="xtext:Assignment" feature="Tags" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.1"/>
</elements>
<elements xsi:type="xtext:Assignment" feature="Keys" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.2"/>
</elements>
<elements xsi:type="xtext:Assignment" feature="MacroCalls" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.4"/>
</elements>
<elements xsi:type="xtext:Assignment" feature="MacroDefines" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.7"/>
</elements>
<elements xsi:type="xtext:Assignment" feature="Textdomains" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.9"/>
</elements>
<elements xsi:type="xtext:Assignment" feature="Values" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.10"/>
</elements>
<elements xsi:type="xtext:Assignment" feature="IfDefs" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.8"/>
</elements>
<elements xsi:type="xtext:Assignment" feature="Elses" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.19"/>
</elements>
</elements>
<elements xsi:type="xtext:RuleCall" rule="//@rules.20"/>
</alternatives>
</rules>
<rules xsi:type="xtext:ParserRule" name="WMLTextdomain">
@ -182,7 +238,7 @@
<classifier xsi:type="ecore:EClass" href="http://www.wesnoth.org/WML#//WMLTextdomain"/>
</type>
<alternatives xsi:type="xtext:Assignment" feature="name" operator="=">
<terminal xsi:type="xtext:RuleCall" rule="//@rules.16"/>
<terminal xsi:type="xtext:RuleCall" rule="//@rules.23"/>
</alternatives>
</rules>
<rules xsi:type="xtext:ParserRule" name="WMLValue">
@ -191,15 +247,17 @@
</type>
<alternatives xsi:type="xtext:Assignment" feature="value" operator="=">
<terminal xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:RuleCall" rule="//@rules.18"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.10"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.25"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.11"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.17"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.12"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.24"/>
<elements xsi:type="xtext:Keyword" value="~"/>
<elements xsi:type="xtext:Keyword" value="."/>
<elements xsi:type="xtext:Keyword" value="$"/>
<elements xsi:type="xtext:Keyword" value="/"/>
<elements xsi:type="xtext:Keyword" value="("/>
<elements xsi:type="xtext:Keyword" value=")"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.21"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.28"/>
</terminal>
</alternatives>
</rules>
@ -209,7 +267,7 @@
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:Keyword" value="_"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.17"/>
<elements xsi:type="xtext:RuleCall" rule="//@rules.24"/>
</alternatives>
</rules>
<rules xsi:type="xtext:ParserRule" name="TVAR">
@ -243,6 +301,114 @@
</elements>
</alternatives>
</rules>
<rules xsi:type="xtext:TerminalRule" name="IFHAVE">
<type metamodel="//@metamodelDeclarations.1">
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:Keyword" value="#ifhave"/>
<elements xsi:type="xtext:NegatedToken" cardinality="*">
<terminal xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:Keyword" value="&#xA;"/>
<elements xsi:type="xtext:Keyword" value="&#xD;"/>
</terminal>
</elements>
<elements xsi:type="xtext:Group" cardinality="?">
<elements xsi:type="xtext:Keyword" cardinality="?" value="&#xD;"/>
<elements xsi:type="xtext:Keyword" value="&#xA;"/>
</elements>
</alternatives>
</rules>
<rules xsi:type="xtext:TerminalRule" name="IFNHAVE">
<type metamodel="//@metamodelDeclarations.1">
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:Keyword" value="#ifnhave"/>
<elements xsi:type="xtext:NegatedToken" cardinality="*">
<terminal xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:Keyword" value="&#xA;"/>
<elements xsi:type="xtext:Keyword" value="&#xD;"/>
</terminal>
</elements>
<elements xsi:type="xtext:Group" cardinality="?">
<elements xsi:type="xtext:Keyword" cardinality="?" value="&#xD;"/>
<elements xsi:type="xtext:Keyword" value="&#xA;"/>
</elements>
</alternatives>
</rules>
<rules xsi:type="xtext:TerminalRule" name="IFDEF">
<type metamodel="//@metamodelDeclarations.1">
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:Keyword" value="#ifdef"/>
<elements xsi:type="xtext:NegatedToken" cardinality="*">
<terminal xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:Keyword" value="&#xA;"/>
<elements xsi:type="xtext:Keyword" value="&#xD;"/>
</terminal>
</elements>
<elements xsi:type="xtext:Group" cardinality="?">
<elements xsi:type="xtext:Keyword" cardinality="?" value="&#xD;"/>
<elements xsi:type="xtext:Keyword" value="&#xA;"/>
</elements>
</alternatives>
</rules>
<rules xsi:type="xtext:TerminalRule" name="IFNDEF">
<type metamodel="//@metamodelDeclarations.1">
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:Keyword" value="#ifndef"/>
<elements xsi:type="xtext:NegatedToken" cardinality="*">
<terminal xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:Keyword" value="&#xA;"/>
<elements xsi:type="xtext:Keyword" value="&#xD;"/>
</terminal>
</elements>
<elements xsi:type="xtext:Group" cardinality="?">
<elements xsi:type="xtext:Keyword" cardinality="?" value="&#xD;"/>
<elements xsi:type="xtext:Keyword" value="&#xA;"/>
</elements>
</alternatives>
</rules>
<rules xsi:type="xtext:TerminalRule" name="ELSE">
<type metamodel="//@metamodelDeclarations.1">
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:Keyword" value="#else"/>
<elements xsi:type="xtext:NegatedToken" cardinality="*">
<terminal xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:Keyword" value="&#xA;"/>
<elements xsi:type="xtext:Keyword" value="&#xD;"/>
</terminal>
</elements>
<elements xsi:type="xtext:Group" cardinality="?">
<elements xsi:type="xtext:Keyword" cardinality="?" value="&#xD;"/>
<elements xsi:type="xtext:Keyword" value="&#xA;"/>
</elements>
</alternatives>
</rules>
<rules xsi:type="xtext:TerminalRule" name="ENDIF">
<type metamodel="//@metamodelDeclarations.1">
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:Keyword" value="#endif"/>
<elements xsi:type="xtext:NegatedToken" cardinality="*">
<terminal xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:Keyword" value="&#xA;"/>
<elements xsi:type="xtext:Keyword" value="&#xD;"/>
</terminal>
</elements>
<elements xsi:type="xtext:Group" cardinality="?">
<elements xsi:type="xtext:Keyword" cardinality="?" value="&#xD;"/>
<elements xsi:type="xtext:Keyword" value="&#xA;"/>
</elements>
</alternatives>
</rules>
<rules xsi:type="xtext:TerminalRule" name="DEFINE">
<type metamodel="//@metamodelDeclarations.1">
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>

View file

@ -39,9 +39,10 @@ protected class ThisRootNode extends RootToken {
case 5: return new WMLLuaCode_ValueAssignment(this, this, 5, inst);
case 6: return new WMLArrayCall_Group(this, this, 6, inst);
case 7: return new WMLMacroDefine_Group(this, this, 7, inst);
case 8: return new WMLTextdomain_NameAssignment(this, this, 8, inst);
case 9: return new WMLValue_ValueAssignment(this, this, 9, inst);
case 10: return new MacroTokens_ValAssignment(this, this, 10, inst);
case 8: return new WMLPreprocIF_Group(this, this, 8, inst);
case 9: return new WMLTextdomain_NameAssignment(this, this, 9, inst);
case 10: return new WMLValue_ValueAssignment(this, this, 10, inst);
case 11: return new MacroTokens_ValAssignment(this, this, 11, inst);
default: return null;
}
}
@ -54,11 +55,13 @@ protected class ThisRootNode extends RootToken {
* //handles TODO:
* // - preprocessor commands: #define, #enddef, etc
* WMLRoot:
* (Tags+=WMLTag | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain)*;
* (Tags+=WMLTag | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain |
* IfDefs+=WMLPreprocIF)*;
*
**/
// (Tags+=WMLTag | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain)*
// (Tags+=WMLTag | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain |
// IfDefs+=WMLPreprocIF)*
protected class WMLRoot_Alternatives extends AlternativesToken {
public WMLRoot_Alternatives(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
@ -77,6 +80,7 @@ protected class WMLRoot_Alternatives extends AlternativesToken {
case 1: return new WMLRoot_MacroCallsAssignment_1(lastRuleCallOrigin, this, 1, inst);
case 2: return new WMLRoot_MacroDefinesAssignment_2(lastRuleCallOrigin, this, 2, inst);
case 3: return new WMLRoot_TextdomainsAssignment_3(lastRuleCallOrigin, this, 3, inst);
case 4: return new WMLRoot_IfDefsAssignment_4(lastRuleCallOrigin, this, 4, inst);
default: return null;
}
}
@ -267,6 +271,52 @@ protected class WMLRoot_TextdomainsAssignment_3 extends AssignmentToken {
}
}
// IfDefs+=WMLPreprocIF
protected class WMLRoot_IfDefsAssignment_4 extends AssignmentToken {
public WMLRoot_IfDefsAssignment_4(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public Assignment getGrammarElement() {
return grammarAccess.getWMLRootAccess().getIfDefsAssignment_4();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLPreprocIF_Group(this, this, 0, inst);
default: return null;
}
}
@Override
public IEObjectConsumer tryConsume() {
if((value = eObjectConsumer.getConsumable("IfDefs",true)) == null) return null;
IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("IfDefs");
if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
IEObjectConsumer param = createEObjectConsumer((EObject)value);
if(param.isInstanceOf(grammarAccess.getWMLPreprocIFRule().getType().getClassifier())) {
type = AssignmentType.PARSER_RULE_CALL;
element = grammarAccess.getWMLRootAccess().getIfDefsWMLPreprocIFParserRuleCall_4_0();
consumed = obj;
return param;
}
}
return null;
}
@Override
public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
if(value == inst.getEObject() && !inst.isConsumed()) return null;
switch(index) {
case 0: return new WMLRoot_Alternatives(lastRuleCallOrigin, next, actIndex, consumed);
default: return lastRuleCallOrigin.createFollowerAfterReturn(next, actIndex , index - 1, consumed);
}
}
}
/************ end Rule WMLRoot ****************/
@ -275,12 +325,12 @@ protected class WMLRoot_TextdomainsAssignment_3 extends AssignmentToken {
*
* WMLTag:
* "[" plus?="+"? name=ID "]" (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine |
* Textdomains+=WMLTextdomain)* "[/" endName=ID "]";
* Textdomains+=WMLTextdomain | IfDefs+=WMLPreprocIF)* "[/" endName=ID "]";
*
**/
// "[" plus?="+"? name=ID "]" (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine |
// Textdomains+=WMLTextdomain)* "[/" endName=ID "]"
// Textdomains+=WMLTextdomain | IfDefs+=WMLPreprocIF)* "[/" endName=ID "]"
protected class WMLTag_Group extends GroupToken {
public WMLTag_Group(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
@ -421,7 +471,8 @@ protected class WMLTag_RightSquareBracketKeyword_3 extends KeywordToken {
}
// (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain)*
// (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain |
// IfDefs+=WMLPreprocIF)*
protected class WMLTag_Alternatives_4 extends AlternativesToken {
public WMLTag_Alternatives_4(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
@ -441,6 +492,7 @@ protected class WMLTag_Alternatives_4 extends AlternativesToken {
case 2: return new WMLTag_MacroCallsAssignment_4_2(lastRuleCallOrigin, this, 2, inst);
case 3: return new WMLTag_MacroDefinesAssignment_4_3(lastRuleCallOrigin, this, 3, inst);
case 4: return new WMLTag_TextdomainsAssignment_4_4(lastRuleCallOrigin, this, 4, inst);
case 5: return new WMLTag_IfDefsAssignment_4_5(lastRuleCallOrigin, this, 5, inst);
default: return null;
}
}
@ -682,6 +734,53 @@ protected class WMLTag_TextdomainsAssignment_4_4 extends AssignmentToken {
}
}
// IfDefs+=WMLPreprocIF
protected class WMLTag_IfDefsAssignment_4_5 extends AssignmentToken {
public WMLTag_IfDefsAssignment_4_5(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public Assignment getGrammarElement() {
return grammarAccess.getWMLTagAccess().getIfDefsAssignment_4_5();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLPreprocIF_Group(this, this, 0, inst);
default: return null;
}
}
@Override
public IEObjectConsumer tryConsume() {
if((value = eObjectConsumer.getConsumable("IfDefs",true)) == null) return null;
IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("IfDefs");
if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
IEObjectConsumer param = createEObjectConsumer((EObject)value);
if(param.isInstanceOf(grammarAccess.getWMLPreprocIFRule().getType().getClassifier())) {
type = AssignmentType.PARSER_RULE_CALL;
element = grammarAccess.getWMLTagAccess().getIfDefsWMLPreprocIFParserRuleCall_4_5_0();
consumed = obj;
return param;
}
}
return null;
}
@Override
public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
if(value == inst.getEObject() && !inst.isConsumed()) return null;
switch(index) {
case 0: return new WMLTag_Alternatives_4(lastRuleCallOrigin, next, actIndex, consumed);
case 1: return new WMLTag_RightSquareBracketKeyword_3(lastRuleCallOrigin, next, actIndex, consumed);
default: return null;
}
}
}
// "[/"
protected class WMLTag_LeftSquareBracketSolidusKeyword_5 extends KeywordToken {
@ -769,11 +868,11 @@ protected class WMLTag_RightSquareBracketKeyword_7 extends KeywordToken {
/************ begin Rule WMLKey ****************
*
* WMLKey hidden(WS):
* name=ID "=" value+=WMLKeyValue* (EOL? "+" EOL? value+=WMLKeyValue)* (EOL | SL_COMMENT);
* name=ID "=" value+=WMLKeyValue* (EOL? "+" EOL? value+=WMLKeyValue+)* (EOL | SL_COMMENT);
*
**/
// name=ID "=" value+=WMLKeyValue* (EOL? "+" EOL? value+=WMLKeyValue)* (EOL | SL_COMMENT)
// name=ID "=" value+=WMLKeyValue* (EOL? "+" EOL? value+=WMLKeyValue+)* (EOL | SL_COMMENT)
protected class WMLKey_Group extends GroupToken {
public WMLKey_Group(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
@ -904,7 +1003,7 @@ protected class WMLKey_ValueAssignment_2 extends AssignmentToken {
}
}
// (EOL? "+" EOL? value+=WMLKeyValue)*
// (EOL? "+" EOL? value+=WMLKeyValue+)*
protected class WMLKey_Group_3 extends GroupToken {
public WMLKey_Group_3(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
@ -941,16 +1040,15 @@ protected class WMLKey_PlusSignKeyword_3_1 extends KeywordToken {
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLKey_Group_3(lastRuleCallOrigin, this, 0, inst);
case 1: return new WMLKey_ValueAssignment_2(lastRuleCallOrigin, this, 1, inst);
case 2: return new WMLKey_EqualsSignKeyword_1(lastRuleCallOrigin, this, 2, inst);
case 0: return new WMLKey_ValueAssignment_2(lastRuleCallOrigin, this, 0, inst);
case 1: return new WMLKey_EqualsSignKeyword_1(lastRuleCallOrigin, this, 1, inst);
default: return null;
}
}
}
// value+=WMLKeyValue
// value+=WMLKeyValue+
protected class WMLKey_ValueAssignment_3_3 extends AssignmentToken {
public WMLKey_ValueAssignment_3_3(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
@ -990,7 +1088,8 @@ protected class WMLKey_ValueAssignment_3_3 extends AssignmentToken {
public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
if(value == inst.getEObject() && !inst.isConsumed()) return null;
switch(index) {
case 0: return new WMLKey_PlusSignKeyword_3_1(lastRuleCallOrigin, next, actIndex, consumed);
case 0: return new WMLKey_ValueAssignment_3_3(lastRuleCallOrigin, next, actIndex, consumed);
case 1: return new WMLKey_PlusSignKeyword_3_1(lastRuleCallOrigin, next, actIndex, consumed);
default: return null;
}
}
@ -1241,11 +1340,11 @@ protected class WMLKeyValue_WMLArrayCallParserRuleCall_3 extends RuleCallToken {
/************ begin Rule WMLMacroCall ****************
*
* WMLMacroCall:
* "{" "./"? relative?="~"? name=ID (params+=(WMLValue | MacroTokens) | extraMacros+=WMLMacroCall)* "}";
* "{" (point?="." "/")? relative?="~"? name=ID (params+=(WMLValue | MacroTokens) | extraMacros+=WMLMacroCall)* "}";
*
**/
// "{" "./"? relative?="~"? name=ID (params+=(WMLValue | MacroTokens) | extraMacros+=WMLMacroCall)* "}"
// "{" (point?="." "/")? relative?="~"? name=ID (params+=(WMLValue | MacroTokens) | extraMacros+=WMLMacroCall)* "}"
protected class WMLMacroCall_Group extends GroupToken {
public WMLMacroCall_Group(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
@ -1295,6 +1394,85 @@ protected class WMLMacroCall_LeftCurlyBracketKeyword_0 extends KeywordToken {
}
// (point?="." "/")?
protected class WMLMacroCall_Group_1 extends GroupToken {
public WMLMacroCall_Group_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public Group getGrammarElement() {
return grammarAccess.getWMLMacroCallAccess().getGroup_1();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLMacroCall_SolidusKeyword_1_1(lastRuleCallOrigin, this, 0, inst);
default: return null;
}
}
}
// point?="."
protected class WMLMacroCall_PointAssignment_1_0 extends AssignmentToken {
public WMLMacroCall_PointAssignment_1_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public Assignment getGrammarElement() {
return grammarAccess.getWMLMacroCallAccess().getPointAssignment_1_0();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLMacroCall_LeftCurlyBracketKeyword_0(lastRuleCallOrigin, this, 0, inst);
default: return null;
}
}
@Override
public IEObjectConsumer tryConsume() {
if((value = eObjectConsumer.getConsumable("point",false)) == null) return null;
IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("point");
if(Boolean.TRUE.equals(value)) { // org::eclipse::xtext::impl::KeywordImpl
type = AssignmentType.KEYWORD;
element = grammarAccess.getWMLMacroCallAccess().getPointFullStopKeyword_1_0_0();
return obj;
}
return null;
}
}
// "/"
protected class WMLMacroCall_SolidusKeyword_1_1 extends KeywordToken {
public WMLMacroCall_SolidusKeyword_1_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public Keyword getGrammarElement() {
return grammarAccess.getWMLMacroCallAccess().getSolidusKeyword_1_1();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLMacroCall_PointAssignment_1_0(lastRuleCallOrigin, this, 0, inst);
default: return null;
}
}
}
// relative?="~"?
protected class WMLMacroCall_RelativeAssignment_2 extends AssignmentToken {
@ -1310,7 +1488,8 @@ protected class WMLMacroCall_RelativeAssignment_2 extends AssignmentToken {
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLMacroCall_LeftCurlyBracketKeyword_0(lastRuleCallOrigin, this, 0, inst);
case 0: return new WMLMacroCall_Group_1(lastRuleCallOrigin, this, 0, inst);
case 1: return new WMLMacroCall_LeftCurlyBracketKeyword_0(lastRuleCallOrigin, this, 1, inst);
default: return null;
}
}
@ -1345,7 +1524,8 @@ protected class WMLMacroCall_NameAssignment_3 extends AssignmentToken {
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLMacroCall_RelativeAssignment_2(lastRuleCallOrigin, this, 0, inst);
case 1: return new WMLMacroCall_LeftCurlyBracketKeyword_0(lastRuleCallOrigin, this, 1, inst);
case 1: return new WMLMacroCall_Group_1(lastRuleCallOrigin, this, 1, inst);
case 2: return new WMLMacroCall_LeftCurlyBracketKeyword_0(lastRuleCallOrigin, this, 2, inst);
default: return null;
}
}
@ -1698,12 +1878,12 @@ protected class WMLArrayCall_RightSquareBracketKeyword_2 extends KeywordToken {
*
* WMLMacroDefine:
* name=DEFINE (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine |
* Textdomains+=WMLTextdomain | Values+=WMLValue)* ENDDEF;
* Textdomains+=WMLTextdomain | Values+=WMLValue | IfDefs+=WMLPreprocIF)* ENDDEF;
*
**/
// name=DEFINE (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine |
// Textdomains+=WMLTextdomain | Values+=WMLValue)* ENDDEF
// Textdomains+=WMLTextdomain | Values+=WMLValue | IfDefs+=WMLPreprocIF)* ENDDEF
protected class WMLMacroDefine_Group extends GroupToken {
public WMLMacroDefine_Group(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
@ -1766,7 +1946,7 @@ protected class WMLMacroDefine_NameAssignment_0 extends AssignmentToken {
}
// (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain |
// Values+=WMLValue)*
// Values+=WMLValue | IfDefs+=WMLPreprocIF)*
protected class WMLMacroDefine_Alternatives_1 extends AlternativesToken {
public WMLMacroDefine_Alternatives_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
@ -1787,6 +1967,7 @@ protected class WMLMacroDefine_Alternatives_1 extends AlternativesToken {
case 3: return new WMLMacroDefine_MacroDefinesAssignment_1_3(lastRuleCallOrigin, this, 3, inst);
case 4: return new WMLMacroDefine_TextdomainsAssignment_1_4(lastRuleCallOrigin, this, 4, inst);
case 5: return new WMLMacroDefine_ValuesAssignment_1_5(lastRuleCallOrigin, this, 5, inst);
case 6: return new WMLMacroDefine_IfDefsAssignment_1_6(lastRuleCallOrigin, this, 6, inst);
default: return null;
}
}
@ -2075,6 +2256,53 @@ protected class WMLMacroDefine_ValuesAssignment_1_5 extends AssignmentToken {
}
}
// IfDefs+=WMLPreprocIF
protected class WMLMacroDefine_IfDefsAssignment_1_6 extends AssignmentToken {
public WMLMacroDefine_IfDefsAssignment_1_6(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public Assignment getGrammarElement() {
return grammarAccess.getWMLMacroDefineAccess().getIfDefsAssignment_1_6();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLPreprocIF_Group(this, this, 0, inst);
default: return null;
}
}
@Override
public IEObjectConsumer tryConsume() {
if((value = eObjectConsumer.getConsumable("IfDefs",true)) == null) return null;
IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("IfDefs");
if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
IEObjectConsumer param = createEObjectConsumer((EObject)value);
if(param.isInstanceOf(grammarAccess.getWMLPreprocIFRule().getType().getClassifier())) {
type = AssignmentType.PARSER_RULE_CALL;
element = grammarAccess.getWMLMacroDefineAccess().getIfDefsWMLPreprocIFParserRuleCall_1_6_0();
consumed = obj;
return param;
}
}
return null;
}
@Override
public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
if(value == inst.getEObject() && !inst.isConsumed()) return null;
switch(index) {
case 0: return new WMLMacroDefine_Alternatives_1(lastRuleCallOrigin, next, actIndex, consumed);
case 1: return new WMLMacroDefine_NameAssignment_0(lastRuleCallOrigin, next, actIndex, consumed);
default: return null;
}
}
}
// ENDDEF
protected class WMLMacroDefine_ENDDEFTerminalRuleCall_2 extends UnassignedTextToken {
@ -2103,6 +2331,516 @@ protected class WMLMacroDefine_ENDDEFTerminalRuleCall_2 extends UnassignedTextTo
/************ end Rule WMLMacroDefine ****************/
/************ begin Rule WMLPreprocIF ****************
*
* WMLPreprocIF:
* name=(IFDEF | IFNDEF | IFHAVE | IFNHAVE) (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall |
* MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain | Values+=WMLValue | IfDefs+=WMLPreprocIF | Elses+=ELSE)*
* ENDIF;
*
**/
// name=(IFDEF | IFNDEF | IFHAVE | IFNHAVE) (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall |
// MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain | Values+=WMLValue | IfDefs+=WMLPreprocIF | Elses+=ELSE)*
// ENDIF
protected class WMLPreprocIF_Group extends GroupToken {
public WMLPreprocIF_Group(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public Group getGrammarElement() {
return grammarAccess.getWMLPreprocIFAccess().getGroup();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLPreprocIF_ENDIFTerminalRuleCall_2(lastRuleCallOrigin, this, 0, inst);
default: return null;
}
}
@Override
public IEObjectConsumer tryConsume() {
if(getEObject().eClass() != grammarAccess.getWMLPreprocIFRule().getType().getClassifier())
return null;
return eObjectConsumer;
}
}
// name=(IFDEF | IFNDEF | IFHAVE | IFNHAVE)
protected class WMLPreprocIF_NameAssignment_0 extends AssignmentToken {
public WMLPreprocIF_NameAssignment_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public Assignment getGrammarElement() {
return grammarAccess.getWMLPreprocIFAccess().getNameAssignment_0();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
default: return lastRuleCallOrigin.createFollowerAfterReturn(this, index, index, inst);
}
}
@Override
public IEObjectConsumer tryConsume() {
if((value = eObjectConsumer.getConsumable("name",true)) == null) return null;
IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("name");
if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getWMLPreprocIFAccess().getNameIFDEFTerminalRuleCall_0_0_0(), value, null)) {
type = AssignmentType.TERMINAL_RULE_CALL;
element = grammarAccess.getWMLPreprocIFAccess().getNameIFDEFTerminalRuleCall_0_0_0();
return obj;
}
if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getWMLPreprocIFAccess().getNameIFNDEFTerminalRuleCall_0_0_1(), value, null)) {
type = AssignmentType.TERMINAL_RULE_CALL;
element = grammarAccess.getWMLPreprocIFAccess().getNameIFNDEFTerminalRuleCall_0_0_1();
return obj;
}
if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getWMLPreprocIFAccess().getNameIFHAVETerminalRuleCall_0_0_2(), value, null)) {
type = AssignmentType.TERMINAL_RULE_CALL;
element = grammarAccess.getWMLPreprocIFAccess().getNameIFHAVETerminalRuleCall_0_0_2();
return obj;
}
if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getWMLPreprocIFAccess().getNameIFNHAVETerminalRuleCall_0_0_3(), value, null)) {
type = AssignmentType.TERMINAL_RULE_CALL;
element = grammarAccess.getWMLPreprocIFAccess().getNameIFNHAVETerminalRuleCall_0_0_3();
return obj;
}
return null;
}
}
// (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain |
// Values+=WMLValue | IfDefs+=WMLPreprocIF | Elses+=ELSE)*
protected class WMLPreprocIF_Alternatives_1 extends AlternativesToken {
public WMLPreprocIF_Alternatives_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public Alternatives getGrammarElement() {
return grammarAccess.getWMLPreprocIFAccess().getAlternatives_1();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLPreprocIF_TagsAssignment_1_0(lastRuleCallOrigin, this, 0, inst);
case 1: return new WMLPreprocIF_KeysAssignment_1_1(lastRuleCallOrigin, this, 1, inst);
case 2: return new WMLPreprocIF_MacroCallsAssignment_1_2(lastRuleCallOrigin, this, 2, inst);
case 3: return new WMLPreprocIF_MacroDefinesAssignment_1_3(lastRuleCallOrigin, this, 3, inst);
case 4: return new WMLPreprocIF_TextdomainsAssignment_1_4(lastRuleCallOrigin, this, 4, inst);
case 5: return new WMLPreprocIF_ValuesAssignment_1_5(lastRuleCallOrigin, this, 5, inst);
case 6: return new WMLPreprocIF_IfDefsAssignment_1_6(lastRuleCallOrigin, this, 6, inst);
case 7: return new WMLPreprocIF_ElsesAssignment_1_7(lastRuleCallOrigin, this, 7, inst);
default: return null;
}
}
}
// Tags+=WMLTag
protected class WMLPreprocIF_TagsAssignment_1_0 extends AssignmentToken {
public WMLPreprocIF_TagsAssignment_1_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public Assignment getGrammarElement() {
return grammarAccess.getWMLPreprocIFAccess().getTagsAssignment_1_0();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLTag_Group(this, this, 0, inst);
default: return null;
}
}
@Override
public IEObjectConsumer tryConsume() {
if((value = eObjectConsumer.getConsumable("Tags",true)) == null) return null;
IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("Tags");
if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
IEObjectConsumer param = createEObjectConsumer((EObject)value);
if(param.isInstanceOf(grammarAccess.getWMLTagRule().getType().getClassifier())) {
type = AssignmentType.PARSER_RULE_CALL;
element = grammarAccess.getWMLPreprocIFAccess().getTagsWMLTagParserRuleCall_1_0_0();
consumed = obj;
return param;
}
}
return null;
}
@Override
public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
if(value == inst.getEObject() && !inst.isConsumed()) return null;
switch(index) {
case 0: return new WMLPreprocIF_Alternatives_1(lastRuleCallOrigin, next, actIndex, consumed);
case 1: return new WMLPreprocIF_NameAssignment_0(lastRuleCallOrigin, next, actIndex, consumed);
default: return null;
}
}
}
// Keys+=WMLKey
protected class WMLPreprocIF_KeysAssignment_1_1 extends AssignmentToken {
public WMLPreprocIF_KeysAssignment_1_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public Assignment getGrammarElement() {
return grammarAccess.getWMLPreprocIFAccess().getKeysAssignment_1_1();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLKey_Group(this, this, 0, inst);
default: return null;
}
}
@Override
public IEObjectConsumer tryConsume() {
if((value = eObjectConsumer.getConsumable("Keys",true)) == null) return null;
IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("Keys");
if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
IEObjectConsumer param = createEObjectConsumer((EObject)value);
if(param.isInstanceOf(grammarAccess.getWMLKeyRule().getType().getClassifier())) {
type = AssignmentType.PARSER_RULE_CALL;
element = grammarAccess.getWMLPreprocIFAccess().getKeysWMLKeyParserRuleCall_1_1_0();
consumed = obj;
return param;
}
}
return null;
}
@Override
public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
if(value == inst.getEObject() && !inst.isConsumed()) return null;
switch(index) {
case 0: return new WMLPreprocIF_Alternatives_1(lastRuleCallOrigin, next, actIndex, consumed);
case 1: return new WMLPreprocIF_NameAssignment_0(lastRuleCallOrigin, next, actIndex, consumed);
default: return null;
}
}
}
// MacroCalls+=WMLMacroCall
protected class WMLPreprocIF_MacroCallsAssignment_1_2 extends AssignmentToken {
public WMLPreprocIF_MacroCallsAssignment_1_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public Assignment getGrammarElement() {
return grammarAccess.getWMLPreprocIFAccess().getMacroCallsAssignment_1_2();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLMacroCall_Group(this, this, 0, inst);
default: return null;
}
}
@Override
public IEObjectConsumer tryConsume() {
if((value = eObjectConsumer.getConsumable("MacroCalls",true)) == null) return null;
IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("MacroCalls");
if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
IEObjectConsumer param = createEObjectConsumer((EObject)value);
if(param.isInstanceOf(grammarAccess.getWMLMacroCallRule().getType().getClassifier())) {
type = AssignmentType.PARSER_RULE_CALL;
element = grammarAccess.getWMLPreprocIFAccess().getMacroCallsWMLMacroCallParserRuleCall_1_2_0();
consumed = obj;
return param;
}
}
return null;
}
@Override
public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
if(value == inst.getEObject() && !inst.isConsumed()) return null;
switch(index) {
case 0: return new WMLPreprocIF_Alternatives_1(lastRuleCallOrigin, next, actIndex, consumed);
case 1: return new WMLPreprocIF_NameAssignment_0(lastRuleCallOrigin, next, actIndex, consumed);
default: return null;
}
}
}
// MacroDefines+=WMLMacroDefine
protected class WMLPreprocIF_MacroDefinesAssignment_1_3 extends AssignmentToken {
public WMLPreprocIF_MacroDefinesAssignment_1_3(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public Assignment getGrammarElement() {
return grammarAccess.getWMLPreprocIFAccess().getMacroDefinesAssignment_1_3();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLMacroDefine_Group(this, this, 0, inst);
default: return null;
}
}
@Override
public IEObjectConsumer tryConsume() {
if((value = eObjectConsumer.getConsumable("MacroDefines",true)) == null) return null;
IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("MacroDefines");
if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
IEObjectConsumer param = createEObjectConsumer((EObject)value);
if(param.isInstanceOf(grammarAccess.getWMLMacroDefineRule().getType().getClassifier())) {
type = AssignmentType.PARSER_RULE_CALL;
element = grammarAccess.getWMLPreprocIFAccess().getMacroDefinesWMLMacroDefineParserRuleCall_1_3_0();
consumed = obj;
return param;
}
}
return null;
}
@Override
public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
if(value == inst.getEObject() && !inst.isConsumed()) return null;
switch(index) {
case 0: return new WMLPreprocIF_Alternatives_1(lastRuleCallOrigin, next, actIndex, consumed);
case 1: return new WMLPreprocIF_NameAssignment_0(lastRuleCallOrigin, next, actIndex, consumed);
default: return null;
}
}
}
// Textdomains+=WMLTextdomain
protected class WMLPreprocIF_TextdomainsAssignment_1_4 extends AssignmentToken {
public WMLPreprocIF_TextdomainsAssignment_1_4(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public Assignment getGrammarElement() {
return grammarAccess.getWMLPreprocIFAccess().getTextdomainsAssignment_1_4();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLTextdomain_NameAssignment(this, this, 0, inst);
default: return null;
}
}
@Override
public IEObjectConsumer tryConsume() {
if((value = eObjectConsumer.getConsumable("Textdomains",true)) == null) return null;
IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("Textdomains");
if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
IEObjectConsumer param = createEObjectConsumer((EObject)value);
if(param.isInstanceOf(grammarAccess.getWMLTextdomainRule().getType().getClassifier())) {
type = AssignmentType.PARSER_RULE_CALL;
element = grammarAccess.getWMLPreprocIFAccess().getTextdomainsWMLTextdomainParserRuleCall_1_4_0();
consumed = obj;
return param;
}
}
return null;
}
@Override
public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
if(value == inst.getEObject() && !inst.isConsumed()) return null;
switch(index) {
case 0: return new WMLPreprocIF_Alternatives_1(lastRuleCallOrigin, next, actIndex, consumed);
case 1: return new WMLPreprocIF_NameAssignment_0(lastRuleCallOrigin, next, actIndex, consumed);
default: return null;
}
}
}
// Values+=WMLValue
protected class WMLPreprocIF_ValuesAssignment_1_5 extends AssignmentToken {
public WMLPreprocIF_ValuesAssignment_1_5(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public Assignment getGrammarElement() {
return grammarAccess.getWMLPreprocIFAccess().getValuesAssignment_1_5();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLValue_ValueAssignment(this, this, 0, inst);
default: return null;
}
}
@Override
public IEObjectConsumer tryConsume() {
if((value = eObjectConsumer.getConsumable("Values",true)) == null) return null;
IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("Values");
if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
IEObjectConsumer param = createEObjectConsumer((EObject)value);
if(param.isInstanceOf(grammarAccess.getWMLValueRule().getType().getClassifier())) {
type = AssignmentType.PARSER_RULE_CALL;
element = grammarAccess.getWMLPreprocIFAccess().getValuesWMLValueParserRuleCall_1_5_0();
consumed = obj;
return param;
}
}
return null;
}
@Override
public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
if(value == inst.getEObject() && !inst.isConsumed()) return null;
switch(index) {
case 0: return new WMLPreprocIF_Alternatives_1(lastRuleCallOrigin, next, actIndex, consumed);
case 1: return new WMLPreprocIF_NameAssignment_0(lastRuleCallOrigin, next, actIndex, consumed);
default: return null;
}
}
}
// IfDefs+=WMLPreprocIF
protected class WMLPreprocIF_IfDefsAssignment_1_6 extends AssignmentToken {
public WMLPreprocIF_IfDefsAssignment_1_6(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public Assignment getGrammarElement() {
return grammarAccess.getWMLPreprocIFAccess().getIfDefsAssignment_1_6();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLPreprocIF_Group(this, this, 0, inst);
default: return null;
}
}
@Override
public IEObjectConsumer tryConsume() {
if((value = eObjectConsumer.getConsumable("IfDefs",true)) == null) return null;
IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("IfDefs");
if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
IEObjectConsumer param = createEObjectConsumer((EObject)value);
if(param.isInstanceOf(grammarAccess.getWMLPreprocIFRule().getType().getClassifier())) {
type = AssignmentType.PARSER_RULE_CALL;
element = grammarAccess.getWMLPreprocIFAccess().getIfDefsWMLPreprocIFParserRuleCall_1_6_0();
consumed = obj;
return param;
}
}
return null;
}
@Override
public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
if(value == inst.getEObject() && !inst.isConsumed()) return null;
switch(index) {
case 0: return new WMLPreprocIF_Alternatives_1(lastRuleCallOrigin, next, actIndex, consumed);
case 1: return new WMLPreprocIF_NameAssignment_0(lastRuleCallOrigin, next, actIndex, consumed);
default: return null;
}
}
}
// Elses+=ELSE
protected class WMLPreprocIF_ElsesAssignment_1_7 extends AssignmentToken {
public WMLPreprocIF_ElsesAssignment_1_7(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public Assignment getGrammarElement() {
return grammarAccess.getWMLPreprocIFAccess().getElsesAssignment_1_7();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLPreprocIF_Alternatives_1(lastRuleCallOrigin, this, 0, inst);
case 1: return new WMLPreprocIF_NameAssignment_0(lastRuleCallOrigin, this, 1, inst);
default: return null;
}
}
@Override
public IEObjectConsumer tryConsume() {
if((value = eObjectConsumer.getConsumable("Elses",true)) == null) return null;
IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("Elses");
if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getWMLPreprocIFAccess().getElsesELSETerminalRuleCall_1_7_0(), value, null)) {
type = AssignmentType.TERMINAL_RULE_CALL;
element = grammarAccess.getWMLPreprocIFAccess().getElsesELSETerminalRuleCall_1_7_0();
return obj;
}
return null;
}
}
// ENDIF
protected class WMLPreprocIF_ENDIFTerminalRuleCall_2 extends UnassignedTextToken {
public WMLPreprocIF_ENDIFTerminalRuleCall_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
}
@Override
public RuleCall getGrammarElement() {
return grammarAccess.getWMLPreprocIFAccess().getENDIFTerminalRuleCall_2();
}
@Override
public AbstractToken createFollower(int index, IEObjectConsumer inst) {
switch(index) {
case 0: return new WMLPreprocIF_Alternatives_1(lastRuleCallOrigin, this, 0, inst);
case 1: return new WMLPreprocIF_NameAssignment_0(lastRuleCallOrigin, this, 1, inst);
default: return null;
}
}
}
/************ end Rule WMLPreprocIF ****************/
/************ begin Rule WMLTextdomain ****************
*
* WMLTextdomain:
@ -2151,11 +2889,11 @@ protected class WMLTextdomain_NameAssignment extends AssignmentToken {
/************ begin Rule WMLValue ****************
*
* WMLValue:
* value=(ID | TSTRING | TVAR | STRING | "~" | "." | "(" | ")" | ANY_OTHER);
* value=(ID | TSTRING | TVAR | STRING | "~" | "." | "$" | "/" | "(" | ")" | ANY_OTHER);
*
**/
// value=(ID | TSTRING | TVAR | STRING | "~" | "." | "(" | ")" | ANY_OTHER)
// value=(ID | TSTRING | TVAR | STRING | "~" | "." | "$" | "/" | "(" | ")" | ANY_OTHER)
protected class WMLValue_ValueAssignment extends AssignmentToken {
public WMLValue_ValueAssignment(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
@ -2190,14 +2928,24 @@ protected class WMLValue_ValueAssignment extends AssignmentToken {
element = grammarAccess.getWMLValueAccess().getValueFullStopKeyword_0_5();
return obj;
}
if(keywordSerializer.isValid(obj.getEObject(), grammarAccess.getWMLValueAccess().getValueLeftParenthesisKeyword_0_6(), value, null)) {
if(keywordSerializer.isValid(obj.getEObject(), grammarAccess.getWMLValueAccess().getValueDollarSignKeyword_0_6(), value, null)) {
type = AssignmentType.KEYWORD;
element = grammarAccess.getWMLValueAccess().getValueLeftParenthesisKeyword_0_6();
element = grammarAccess.getWMLValueAccess().getValueDollarSignKeyword_0_6();
return obj;
}
if(keywordSerializer.isValid(obj.getEObject(), grammarAccess.getWMLValueAccess().getValueRightParenthesisKeyword_0_7(), value, null)) {
if(keywordSerializer.isValid(obj.getEObject(), grammarAccess.getWMLValueAccess().getValueSolidusKeyword_0_7(), value, null)) {
type = AssignmentType.KEYWORD;
element = grammarAccess.getWMLValueAccess().getValueRightParenthesisKeyword_0_7();
element = grammarAccess.getWMLValueAccess().getValueSolidusKeyword_0_7();
return obj;
}
if(keywordSerializer.isValid(obj.getEObject(), grammarAccess.getWMLValueAccess().getValueLeftParenthesisKeyword_0_8(), value, null)) {
type = AssignmentType.KEYWORD;
element = grammarAccess.getWMLValueAccess().getValueLeftParenthesisKeyword_0_8();
return obj;
}
if(keywordSerializer.isValid(obj.getEObject(), grammarAccess.getWMLValueAccess().getValueRightParenthesisKeyword_0_9(), value, null)) {
type = AssignmentType.KEYWORD;
element = grammarAccess.getWMLValueAccess().getValueRightParenthesisKeyword_0_9();
return obj;
}
if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getWMLValueAccess().getValueIDTerminalRuleCall_0_0(), value, null)) {
@ -2220,9 +2968,9 @@ protected class WMLValue_ValueAssignment extends AssignmentToken {
element = grammarAccess.getWMLValueAccess().getValueSTRINGTerminalRuleCall_0_3();
return obj;
}
if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getWMLValueAccess().getValueANY_OTHERTerminalRuleCall_0_8(), value, null)) {
if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getWMLValueAccess().getValueANY_OTHERTerminalRuleCall_0_10(), value, null)) {
type = AssignmentType.TERMINAL_RULE_CALL;
element = grammarAccess.getWMLValueAccess().getValueANY_OTHERTerminalRuleCall_0_8();
element = grammarAccess.getWMLValueAccess().getValueANY_OTHERTerminalRuleCall_0_10();
return obj;
}
return null;

View file

@ -187,6 +187,31 @@ ruleWMLRoot returns [EObject current=null]
currentNode = currentNode.getParent();
}
)
)
|(
(
{
currentNode=createCompositeNode(grammarAccess.getWMLRootAccess().getIfDefsWMLPreprocIFParserRuleCall_4_0(), currentNode);
}
lv_IfDefs_4_0=ruleWMLPreprocIF {
if ($current==null) {
$current = factory.create(grammarAccess.getWMLRootRule().getType().getClassifier());
associateNodeWithAstElement(currentNode.getParent(), $current);
}
try {
add(
$current,
"IfDefs",
lv_IfDefs_4_0,
"WMLPreprocIF",
currentNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
currentNode = currentNode.getParent();
}
)
))*
;
@ -387,6 +412,31 @@ ruleWMLTag returns [EObject current=null]
currentNode = currentNode.getParent();
}
)
)
|(
(
{
currentNode=createCompositeNode(grammarAccess.getWMLTagAccess().getIfDefsWMLPreprocIFParserRuleCall_4_5_0(), currentNode);
}
lv_IfDefs_9_0=ruleWMLPreprocIF {
if ($current==null) {
$current = factory.create(grammarAccess.getWMLTagRule().getType().getClassifier());
associateNodeWithAstElement(currentNode.getParent(), $current);
}
try {
add(
$current,
"IfDefs",
lv_IfDefs_9_0,
"WMLPreprocIF",
currentNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
currentNode = currentNode.getParent();
}
)
))* '[/'
{
@ -394,7 +444,7 @@ ruleWMLTag returns [EObject current=null]
}
(
(
lv_endName_10_0=RULE_ID
lv_endName_11_0=RULE_ID
{
createLeafNode(grammarAccess.getWMLTagAccess().getEndNameIDTerminalRuleCall_6_0(), "endName");
}
@ -407,7 +457,7 @@ ruleWMLTag returns [EObject current=null]
set(
$current,
"endName",
lv_endName_10_0,
lv_endName_11_0,
"ID",
lastConsumedNode);
} catch (ValueConverterException vce) {
@ -538,7 +588,7 @@ ruleWMLKey returns [EObject current=null]
}
)
))*(RULE_EOL
)+)*(RULE_EOL
{
createLeafNode(grammarAccess.getWMLKeyAccess().getEOLTerminalRuleCall_4_0(), null);
}
@ -639,13 +689,34 @@ ruleWMLMacroCall returns [EObject current=null]
{
createLeafNode(grammarAccess.getWMLMacroCallAccess().getLeftCurlyBracketKeyword_0(), null);
}
( './'
((
(
lv_point_1_0= '.'
{
createLeafNode(grammarAccess.getWMLMacroCallAccess().getFullStopSolidusKeyword_1(), null);
createLeafNode(grammarAccess.getWMLMacroCallAccess().getPointFullStopKeyword_1_0_0(), "point");
}
{
if ($current==null) {
$current = factory.create(grammarAccess.getWMLMacroCallRule().getType().getClassifier());
associateNodeWithAstElement(currentNode, $current);
}
try {
set($current, "point", true, ".", lastConsumedNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
}
)
) '/'
{
createLeafNode(grammarAccess.getWMLMacroCallAccess().getSolidusKeyword_1_1(), null);
}
)?(
(
lv_relative_2_0= '~'
lv_relative_3_0= '~'
{
createLeafNode(grammarAccess.getWMLMacroCallAccess().getRelativeTildeKeyword_2_0(), "relative");
}
@ -666,7 +737,7 @@ ruleWMLMacroCall returns [EObject current=null]
)
)?(
(
lv_name_3_0=RULE_ID
lv_name_4_0=RULE_ID
{
createLeafNode(grammarAccess.getWMLMacroCallAccess().getNameIDTerminalRuleCall_3_0(), "name");
}
@ -679,7 +750,7 @@ ruleWMLMacroCall returns [EObject current=null]
set(
$current,
"name",
lv_name_3_0,
lv_name_4_0,
"ID",
lastConsumedNode);
} catch (ValueConverterException vce) {
@ -694,7 +765,7 @@ ruleWMLMacroCall returns [EObject current=null]
{
currentNode=createCompositeNode(grammarAccess.getWMLMacroCallAccess().getParamsWMLValueParserRuleCall_4_0_0_0(), currentNode);
}
lv_params_4_1=ruleWMLValue {
lv_params_5_1=ruleWMLValue {
if ($current==null) {
$current = factory.create(grammarAccess.getWMLMacroCallRule().getType().getClassifier());
associateNodeWithAstElement(currentNode.getParent(), $current);
@ -703,7 +774,7 @@ ruleWMLMacroCall returns [EObject current=null]
add(
$current,
"params",
lv_params_4_1,
lv_params_5_1,
"WMLValue",
currentNode);
} catch (ValueConverterException vce) {
@ -715,7 +786,7 @@ ruleWMLMacroCall returns [EObject current=null]
| {
currentNode=createCompositeNode(grammarAccess.getWMLMacroCallAccess().getParamsMacroTokensParserRuleCall_4_0_0_1(), currentNode);
}
lv_params_4_2=ruleMacroTokens {
lv_params_5_2=ruleMacroTokens {
if ($current==null) {
$current = factory.create(grammarAccess.getWMLMacroCallRule().getType().getClassifier());
associateNodeWithAstElement(currentNode.getParent(), $current);
@ -724,7 +795,7 @@ ruleWMLMacroCall returns [EObject current=null]
add(
$current,
"params",
lv_params_4_2,
lv_params_5_2,
"MacroTokens",
currentNode);
} catch (ValueConverterException vce) {
@ -742,7 +813,7 @@ ruleWMLMacroCall returns [EObject current=null]
{
currentNode=createCompositeNode(grammarAccess.getWMLMacroCallAccess().getExtraMacrosWMLMacroCallParserRuleCall_4_1_0(), currentNode);
}
lv_extraMacros_5_0=ruleWMLMacroCall {
lv_extraMacros_6_0=ruleWMLMacroCall {
if ($current==null) {
$current = factory.create(grammarAccess.getWMLMacroCallRule().getType().getClassifier());
associateNodeWithAstElement(currentNode.getParent(), $current);
@ -751,7 +822,7 @@ ruleWMLMacroCall returns [EObject current=null]
add(
$current,
"extraMacros",
lv_extraMacros_5_0,
lv_extraMacros_6_0,
"WMLMacroCall",
currentNode);
} catch (ValueConverterException vce) {
@ -1062,6 +1133,31 @@ ruleWMLMacroDefine returns [EObject current=null]
currentNode = currentNode.getParent();
}
)
)
|(
(
{
currentNode=createCompositeNode(grammarAccess.getWMLMacroDefineAccess().getIfDefsWMLPreprocIFParserRuleCall_1_6_0(), currentNode);
}
lv_IfDefs_7_0=ruleWMLPreprocIF {
if ($current==null) {
$current = factory.create(grammarAccess.getWMLMacroDefineRule().getType().getClassifier());
associateNodeWithAstElement(currentNode.getParent(), $current);
}
try {
add(
$current,
"IfDefs",
lv_IfDefs_7_0,
"WMLPreprocIF",
currentNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
currentNode = currentNode.getParent();
}
)
))*RULE_ENDDEF
{
@ -1074,6 +1170,322 @@ ruleWMLMacroDefine returns [EObject current=null]
// Entry rule entryRuleWMLPreprocIF
entryRuleWMLPreprocIF returns [EObject current=null]
:
{ currentNode = createCompositeNode(grammarAccess.getWMLPreprocIFRule(), currentNode); }
iv_ruleWMLPreprocIF=ruleWMLPreprocIF
{ $current=$iv_ruleWMLPreprocIF.current; }
EOF
;
// Rule WMLPreprocIF
ruleWMLPreprocIF returns [EObject current=null]
@init { EObject temp=null; setCurrentLookahead(); resetLookahead();
}
@after { resetLookahead();
lastConsumedNode = currentNode;
}:
((
(
(
lv_name_0_1=RULE_IFDEF
{
createLeafNode(grammarAccess.getWMLPreprocIFAccess().getNameIFDEFTerminalRuleCall_0_0_0(), "name");
}
{
if ($current==null) {
$current = factory.create(grammarAccess.getWMLPreprocIFRule().getType().getClassifier());
associateNodeWithAstElement(currentNode, $current);
}
try {
set(
$current,
"name",
lv_name_0_1,
"IFDEF",
lastConsumedNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
}
| lv_name_0_2=RULE_IFNDEF
{
createLeafNode(grammarAccess.getWMLPreprocIFAccess().getNameIFNDEFTerminalRuleCall_0_0_1(), "name");
}
{
if ($current==null) {
$current = factory.create(grammarAccess.getWMLPreprocIFRule().getType().getClassifier());
associateNodeWithAstElement(currentNode, $current);
}
try {
set(
$current,
"name",
lv_name_0_2,
"IFNDEF",
lastConsumedNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
}
| lv_name_0_3=RULE_IFHAVE
{
createLeafNode(grammarAccess.getWMLPreprocIFAccess().getNameIFHAVETerminalRuleCall_0_0_2(), "name");
}
{
if ($current==null) {
$current = factory.create(grammarAccess.getWMLPreprocIFRule().getType().getClassifier());
associateNodeWithAstElement(currentNode, $current);
}
try {
set(
$current,
"name",
lv_name_0_3,
"IFHAVE",
lastConsumedNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
}
| lv_name_0_4=RULE_IFNHAVE
{
createLeafNode(grammarAccess.getWMLPreprocIFAccess().getNameIFNHAVETerminalRuleCall_0_0_3(), "name");
}
{
if ($current==null) {
$current = factory.create(grammarAccess.getWMLPreprocIFRule().getType().getClassifier());
associateNodeWithAstElement(currentNode, $current);
}
try {
set(
$current,
"name",
lv_name_0_4,
"IFNHAVE",
lastConsumedNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
}
)
)
)((
(
{
currentNode=createCompositeNode(grammarAccess.getWMLPreprocIFAccess().getTagsWMLTagParserRuleCall_1_0_0(), currentNode);
}
lv_Tags_1_0=ruleWMLTag {
if ($current==null) {
$current = factory.create(grammarAccess.getWMLPreprocIFRule().getType().getClassifier());
associateNodeWithAstElement(currentNode.getParent(), $current);
}
try {
add(
$current,
"Tags",
lv_Tags_1_0,
"WMLTag",
currentNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
currentNode = currentNode.getParent();
}
)
)
|(
(
{
currentNode=createCompositeNode(grammarAccess.getWMLPreprocIFAccess().getKeysWMLKeyParserRuleCall_1_1_0(), currentNode);
}
lv_Keys_2_0=ruleWMLKey {
if ($current==null) {
$current = factory.create(grammarAccess.getWMLPreprocIFRule().getType().getClassifier());
associateNodeWithAstElement(currentNode.getParent(), $current);
}
try {
add(
$current,
"Keys",
lv_Keys_2_0,
"WMLKey",
currentNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
currentNode = currentNode.getParent();
}
)
)
|(
(
{
currentNode=createCompositeNode(grammarAccess.getWMLPreprocIFAccess().getMacroCallsWMLMacroCallParserRuleCall_1_2_0(), currentNode);
}
lv_MacroCalls_3_0=ruleWMLMacroCall {
if ($current==null) {
$current = factory.create(grammarAccess.getWMLPreprocIFRule().getType().getClassifier());
associateNodeWithAstElement(currentNode.getParent(), $current);
}
try {
add(
$current,
"MacroCalls",
lv_MacroCalls_3_0,
"WMLMacroCall",
currentNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
currentNode = currentNode.getParent();
}
)
)
|(
(
{
currentNode=createCompositeNode(grammarAccess.getWMLPreprocIFAccess().getMacroDefinesWMLMacroDefineParserRuleCall_1_3_0(), currentNode);
}
lv_MacroDefines_4_0=ruleWMLMacroDefine {
if ($current==null) {
$current = factory.create(grammarAccess.getWMLPreprocIFRule().getType().getClassifier());
associateNodeWithAstElement(currentNode.getParent(), $current);
}
try {
add(
$current,
"MacroDefines",
lv_MacroDefines_4_0,
"WMLMacroDefine",
currentNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
currentNode = currentNode.getParent();
}
)
)
|(
(
{
currentNode=createCompositeNode(grammarAccess.getWMLPreprocIFAccess().getTextdomainsWMLTextdomainParserRuleCall_1_4_0(), currentNode);
}
lv_Textdomains_5_0=ruleWMLTextdomain {
if ($current==null) {
$current = factory.create(grammarAccess.getWMLPreprocIFRule().getType().getClassifier());
associateNodeWithAstElement(currentNode.getParent(), $current);
}
try {
add(
$current,
"Textdomains",
lv_Textdomains_5_0,
"WMLTextdomain",
currentNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
currentNode = currentNode.getParent();
}
)
)
|(
(
{
currentNode=createCompositeNode(grammarAccess.getWMLPreprocIFAccess().getValuesWMLValueParserRuleCall_1_5_0(), currentNode);
}
lv_Values_6_0=ruleWMLValue {
if ($current==null) {
$current = factory.create(grammarAccess.getWMLPreprocIFRule().getType().getClassifier());
associateNodeWithAstElement(currentNode.getParent(), $current);
}
try {
add(
$current,
"Values",
lv_Values_6_0,
"WMLValue",
currentNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
currentNode = currentNode.getParent();
}
)
)
|(
(
{
currentNode=createCompositeNode(grammarAccess.getWMLPreprocIFAccess().getIfDefsWMLPreprocIFParserRuleCall_1_6_0(), currentNode);
}
lv_IfDefs_7_0=ruleWMLPreprocIF {
if ($current==null) {
$current = factory.create(grammarAccess.getWMLPreprocIFRule().getType().getClassifier());
associateNodeWithAstElement(currentNode.getParent(), $current);
}
try {
add(
$current,
"IfDefs",
lv_IfDefs_7_0,
"WMLPreprocIF",
currentNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
currentNode = currentNode.getParent();
}
)
)
|(
(
lv_Elses_8_0=RULE_ELSE
{
createLeafNode(grammarAccess.getWMLPreprocIFAccess().getElsesELSETerminalRuleCall_1_7_0(), "Elses");
}
{
if ($current==null) {
$current = factory.create(grammarAccess.getWMLPreprocIFRule().getType().getClassifier());
associateNodeWithAstElement(currentNode, $current);
}
try {
add(
$current,
"Elses",
lv_Elses_8_0,
"ELSE",
lastConsumedNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
}
)
))*RULE_ENDIF
{
createLeafNode(grammarAccess.getWMLPreprocIFAccess().getENDIFTerminalRuleCall_2(), null);
}
)
;
// Entry rule entryRuleWMLTextdomain
entryRuleWMLTextdomain returns [EObject current=null]
:
@ -1260,9 +1672,9 @@ ruleWMLValue returns [EObject current=null]
}
}
| lv_value_0_7= '('
| lv_value_0_7= '$'
{
createLeafNode(grammarAccess.getWMLValueAccess().getValueLeftParenthesisKeyword_0_6(), "value");
createLeafNode(grammarAccess.getWMLValueAccess().getValueDollarSignKeyword_0_6(), "value");
}
{
@ -1278,9 +1690,9 @@ ruleWMLValue returns [EObject current=null]
}
}
| lv_value_0_8= ')'
| lv_value_0_8= '/'
{
createLeafNode(grammarAccess.getWMLValueAccess().getValueRightParenthesisKeyword_0_7(), "value");
createLeafNode(grammarAccess.getWMLValueAccess().getValueSolidusKeyword_0_7(), "value");
}
{
@ -1296,9 +1708,45 @@ ruleWMLValue returns [EObject current=null]
}
}
| lv_value_0_9=RULE_ANY_OTHER
| lv_value_0_9= '('
{
createLeafNode(grammarAccess.getWMLValueAccess().getValueLeftParenthesisKeyword_0_8(), "value");
}
{
if ($current==null) {
$current = factory.create(grammarAccess.getWMLValueRule().getType().getClassifier());
associateNodeWithAstElement(currentNode, $current);
}
try {
set($current, "value", lv_value_0_9, null, lastConsumedNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
}
| lv_value_0_10= ')'
{
createLeafNode(grammarAccess.getWMLValueAccess().getValueRightParenthesisKeyword_0_9(), "value");
}
{
if ($current==null) {
$current = factory.create(grammarAccess.getWMLValueRule().getType().getClassifier());
associateNodeWithAstElement(currentNode, $current);
}
try {
set($current, "value", lv_value_0_10, null, lastConsumedNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
}
| lv_value_0_11=RULE_ANY_OTHER
{
createLeafNode(grammarAccess.getWMLValueAccess().getValueANY_OTHERTerminalRuleCall_0_8(), "value");
createLeafNode(grammarAccess.getWMLValueAccess().getValueANY_OTHERTerminalRuleCall_0_10(), "value");
}
{
if ($current==null) {
@ -1309,7 +1757,7 @@ ruleWMLValue returns [EObject current=null]
set(
$current,
"value",
lv_value_0_9,
lv_value_0_11,
"ANY_OTHER",
lastConsumedNode);
} catch (ValueConverterException vce) {
@ -1513,6 +1961,18 @@ ruleMacroTokens returns [EObject current=null]
RULE_LUA_CODE : '<<' ( options {greedy=false;} : . )*'>>';
RULE_IFHAVE : '#ifhave' ~(('\n'|'\r'))* ('\r'? '\n')?;
RULE_IFNHAVE : '#ifnhave' ~(('\n'|'\r'))* ('\r'? '\n')?;
RULE_IFDEF : '#ifdef' ~(('\n'|'\r'))* ('\r'? '\n')?;
RULE_IFNDEF : '#ifndef' ~(('\n'|'\r'))* ('\r'? '\n')?;
RULE_ELSE : '#else' ~(('\n'|'\r'))* ('\r'? '\n')?;
RULE_ENDIF : '#endif' ~(('\n'|'\r'))* ('\r'? '\n')?;
RULE_DEFINE : '#define' ~(('\n'|'\r'))* ('\r'? '\n')?;
RULE_ENDDEF : '#enddef' ~(('\n'|'\r'))* ('\r'? '\n')?;

View file

@ -1,24 +1,31 @@
RULE_LUA_CODE=7
RULE_ID=4
RULE_STRING=11
RULE_DEFINE=8
RULE_ANY_OTHER=12
RULE_ENDDEF=9
RULE_IFDEF=10
RULE_ANY_OTHER=18
RULE_IFNDEF=11
RULE_EOL=5
RULE_TEXTDOMAIN=10
RULE_WS=13
RULE_TEXTDOMAIN=16
RULE_IFNHAVE=13
RULE_SL_COMMENT=6
'}'=22
'~'=21
'_$'=27
'{'=19
'='=18
'('=24
'['=14
'[/'=17
'+'=15
'_'=26
'.'=23
')'=25
']'=16
'./'=20
RULE_STRING=17
RULE_ENDIF=15
RULE_DEFINE=8
RULE_ENDDEF=9
RULE_IFHAVE=12
RULE_WS=19
RULE_ELSE=14
'$'=30
'}'=29
'~'=28
'/'=27
'_$'=34
'{'=25
'='=24
'('=31
'['=20
'[/'=23
'+'=21
'_'=33
'.'=26
')'=32
']'=22

View file

@ -7,49 +7,68 @@ package org.wesnoth.parser.antlr.internal;
import org.eclipse.xtext.parser.antlr.Lexer;
}
T14 : '[' ;
T15 : '+' ;
T16 : ']' ;
T17 : '[/' ;
T18 : '=' ;
T19 : '{' ;
T20 : './' ;
T21 : '~' ;
T22 : '}' ;
T23 : '.' ;
T24 : '(' ;
T25 : ')' ;
T26 : '_' ;
T27 : '_$' ;
T20 : '[' ;
T21 : '+' ;
T22 : ']' ;
T23 : '[/' ;
T24 : '=' ;
T25 : '{' ;
T26 : '.' ;
T27 : '/' ;
T28 : '~' ;
T29 : '}' ;
T30 : '$' ;
T31 : '(' ;
T32 : ')' ;
T33 : '_' ;
T34 : '_$' ;
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1514
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1962
RULE_LUA_CODE : '<<' ( options {greedy=false;} : . )*'>>';
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1516
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1964
RULE_IFHAVE : '#ifhave' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1966
RULE_IFNHAVE : '#ifnhave' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1968
RULE_IFDEF : '#ifdef' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1970
RULE_IFNDEF : '#ifndef' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1972
RULE_ELSE : '#else' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1974
RULE_ENDIF : '#endif' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1976
RULE_DEFINE : '#define' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1518
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1978
RULE_ENDDEF : '#enddef' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1520
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1980
RULE_TEXTDOMAIN : '#textdomain' ~(('\n'|'\r'))* ('\r'? '\n')?;
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1522
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1982
RULE_STRING : '"' ('\\' ('b'|'t'|'n'|'f'|'r'|'"'|'\''|'\\')|~(('\\'|'"')))* '"';
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1524
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1984
RULE_ID : ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|'-'|',')+;
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1526
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1986
RULE_EOL : ('\r'|'\n');
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1528
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1988
RULE_WS : (' '|'\t')+;
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1530
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1990
RULE_ANY_OTHER : .;
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1532
// $ANTLR src "../org.wesnoth.wml/src-gen/org/wesnoth/parser/antlr/internal/InternalWML.g" 1992
RULE_SL_COMMENT : '#' ~(('\n'|'\r'))* ('\r'? '\n')?;

View file

@ -27,15 +27,19 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
private final RuleCall cMacroDefinesWMLMacroDefineParserRuleCall_2_0 = (RuleCall)cMacroDefinesAssignment_2.eContents().get(0);
private final Assignment cTextdomainsAssignment_3 = (Assignment)cAlternatives.eContents().get(3);
private final RuleCall cTextdomainsWMLTextdomainParserRuleCall_3_0 = (RuleCall)cTextdomainsAssignment_3.eContents().get(0);
private final Assignment cIfDefsAssignment_4 = (Assignment)cAlternatives.eContents().get(4);
private final RuleCall cIfDefsWMLPreprocIFParserRuleCall_4_0 = (RuleCall)cIfDefsAssignment_4.eContents().get(0);
////TODO: add cross-reference for variables
////handles TODO:
//// - preprocessor commands: #define, #enddef, etc
//WMLRoot:
// (Tags+=WMLTag | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain)*;
// (Tags+=WMLTag | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain |
// IfDefs+=WMLPreprocIF)*;
public ParserRule getRule() { return rule; }
//(Tags+=WMLTag | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain)*
//(Tags+=WMLTag | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain |
//IfDefs+=WMLPreprocIF)*
public Alternatives getAlternatives() { return cAlternatives; }
//Tags+=WMLTag
@ -61,6 +65,12 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
//WMLTextdomain
public RuleCall getTextdomainsWMLTextdomainParserRuleCall_3_0() { return cTextdomainsWMLTextdomainParserRuleCall_3_0; }
//IfDefs+=WMLPreprocIF
public Assignment getIfDefsAssignment_4() { return cIfDefsAssignment_4; }
//WMLPreprocIF
public RuleCall getIfDefsWMLPreprocIFParserRuleCall_4_0() { return cIfDefsWMLPreprocIFParserRuleCall_4_0; }
}
public class WMLTagElements extends AbstractParserRuleElementFinder {
@ -83,6 +93,8 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
private final RuleCall cMacroDefinesWMLMacroDefineParserRuleCall_4_3_0 = (RuleCall)cMacroDefinesAssignment_4_3.eContents().get(0);
private final Assignment cTextdomainsAssignment_4_4 = (Assignment)cAlternatives_4.eContents().get(4);
private final RuleCall cTextdomainsWMLTextdomainParserRuleCall_4_4_0 = (RuleCall)cTextdomainsAssignment_4_4.eContents().get(0);
private final Assignment cIfDefsAssignment_4_5 = (Assignment)cAlternatives_4.eContents().get(5);
private final RuleCall cIfDefsWMLPreprocIFParserRuleCall_4_5_0 = (RuleCall)cIfDefsAssignment_4_5.eContents().get(0);
private final Keyword cLeftSquareBracketSolidusKeyword_5 = (Keyword)cGroup.eContents().get(5);
private final Assignment cEndNameAssignment_6 = (Assignment)cGroup.eContents().get(6);
private final RuleCall cEndNameIDTerminalRuleCall_6_0 = (RuleCall)cEndNameAssignment_6.eContents().get(0);
@ -90,11 +102,11 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
//WMLTag:
// "[" plus?="+"? name=ID "]" (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine |
// Textdomains+=WMLTextdomain)* "[/" endName=ID "]";
// Textdomains+=WMLTextdomain | IfDefs+=WMLPreprocIF)* "[/" endName=ID "]";
public ParserRule getRule() { return rule; }
//"[" plus?="+"? name=ID "]" (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine |
//Textdomains+=WMLTextdomain)* "[/" endName=ID "]"
//Textdomains+=WMLTextdomain | IfDefs+=WMLPreprocIF)* "[/" endName=ID "]"
public Group getGroup() { return cGroup; }
//"["
@ -115,7 +127,8 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
//"]"
public Keyword getRightSquareBracketKeyword_3() { return cRightSquareBracketKeyword_3; }
//(Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain)*
//(Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain |
//IfDefs+=WMLPreprocIF)*
public Alternatives getAlternatives_4() { return cAlternatives_4; }
//Tags+=WMLTag
@ -148,6 +161,12 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
//WMLTextdomain
public RuleCall getTextdomainsWMLTextdomainParserRuleCall_4_4_0() { return cTextdomainsWMLTextdomainParserRuleCall_4_4_0; }
//IfDefs+=WMLPreprocIF
public Assignment getIfDefsAssignment_4_5() { return cIfDefsAssignment_4_5; }
//WMLPreprocIF
public RuleCall getIfDefsWMLPreprocIFParserRuleCall_4_5_0() { return cIfDefsWMLPreprocIFParserRuleCall_4_5_0; }
//"[/"
public Keyword getLeftSquareBracketSolidusKeyword_5() { return cLeftSquareBracketSolidusKeyword_5; }
@ -180,10 +199,10 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
private final RuleCall cSL_COMMENTTerminalRuleCall_4_1 = (RuleCall)cAlternatives_4.eContents().get(1);
//WMLKey hidden(WS):
// name=ID "=" value+=WMLKeyValue* (EOL? "+" EOL? value+=WMLKeyValue)* (EOL | SL_COMMENT);
// name=ID "=" value+=WMLKeyValue* (EOL? "+" EOL? value+=WMLKeyValue+)* (EOL | SL_COMMENT);
public ParserRule getRule() { return rule; }
//name=ID "=" value+=WMLKeyValue* (EOL? "+" EOL? value+=WMLKeyValue)* (EOL | SL_COMMENT)
//name=ID "=" value+=WMLKeyValue* (EOL? "+" EOL? value+=WMLKeyValue+)* (EOL | SL_COMMENT)
public Group getGroup() { return cGroup; }
//name=ID
@ -201,7 +220,7 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
//WMLKeyValue
public RuleCall getValueWMLKeyValueParserRuleCall_2_0() { return cValueWMLKeyValueParserRuleCall_2_0; }
//(EOL? "+" EOL? value+=WMLKeyValue)*
//(EOL? "+" EOL? value+=WMLKeyValue+)*
public Group getGroup_3() { return cGroup_3; }
//EOL?
@ -213,7 +232,7 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
//EOL?
public RuleCall getEOLTerminalRuleCall_3_2() { return cEOLTerminalRuleCall_3_2; }
//value+=WMLKeyValue
//value+=WMLKeyValue+
public Assignment getValueAssignment_3_3() { return cValueAssignment_3_3; }
//WMLKeyValue
@ -261,7 +280,10 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "WMLMacroCall");
private final Group cGroup = (Group)rule.eContents().get(1);
private final Keyword cLeftCurlyBracketKeyword_0 = (Keyword)cGroup.eContents().get(0);
private final Keyword cFullStopSolidusKeyword_1 = (Keyword)cGroup.eContents().get(1);
private final Group cGroup_1 = (Group)cGroup.eContents().get(1);
private final Assignment cPointAssignment_1_0 = (Assignment)cGroup_1.eContents().get(0);
private final Keyword cPointFullStopKeyword_1_0_0 = (Keyword)cPointAssignment_1_0.eContents().get(0);
private final Keyword cSolidusKeyword_1_1 = (Keyword)cGroup_1.eContents().get(1);
private final Assignment cRelativeAssignment_2 = (Assignment)cGroup.eContents().get(2);
private final Keyword cRelativeTildeKeyword_2_0 = (Keyword)cRelativeAssignment_2.eContents().get(0);
private final Assignment cNameAssignment_3 = (Assignment)cGroup.eContents().get(3);
@ -276,17 +298,26 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
private final Keyword cRightCurlyBracketKeyword_5 = (Keyword)cGroup.eContents().get(5);
//WMLMacroCall:
// "{" "./"? relative?="~"? name=ID (params+=(WMLValue | MacroTokens) | extraMacros+=WMLMacroCall)* "}";
// "{" (point?="." "/")? relative?="~"? name=ID (params+=(WMLValue | MacroTokens) | extraMacros+=WMLMacroCall)* "}";
public ParserRule getRule() { return rule; }
//"{" "./"? relative?="~"? name=ID (params+=(WMLValue | MacroTokens) | extraMacros+=WMLMacroCall)* "}"
//"{" (point?="." "/")? relative?="~"? name=ID (params+=(WMLValue | MacroTokens) | extraMacros+=WMLMacroCall)* "}"
public Group getGroup() { return cGroup; }
//"{"
public Keyword getLeftCurlyBracketKeyword_0() { return cLeftCurlyBracketKeyword_0; }
//"./"?
public Keyword getFullStopSolidusKeyword_1() { return cFullStopSolidusKeyword_1; }
//(point?="." "/")?
public Group getGroup_1() { return cGroup_1; }
//point?="."
public Assignment getPointAssignment_1_0() { return cPointAssignment_1_0; }
//"."
public Keyword getPointFullStopKeyword_1_0_0() { return cPointFullStopKeyword_1_0_0; }
//"/"
public Keyword getSolidusKeyword_1_1() { return cSolidusKeyword_1_1; }
//relative?="~"?
public Assignment getRelativeAssignment_2() { return cRelativeAssignment_2; }
@ -387,15 +418,17 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
private final RuleCall cTextdomainsWMLTextdomainParserRuleCall_1_4_0 = (RuleCall)cTextdomainsAssignment_1_4.eContents().get(0);
private final Assignment cValuesAssignment_1_5 = (Assignment)cAlternatives_1.eContents().get(5);
private final RuleCall cValuesWMLValueParserRuleCall_1_5_0 = (RuleCall)cValuesAssignment_1_5.eContents().get(0);
private final Assignment cIfDefsAssignment_1_6 = (Assignment)cAlternatives_1.eContents().get(6);
private final RuleCall cIfDefsWMLPreprocIFParserRuleCall_1_6_0 = (RuleCall)cIfDefsAssignment_1_6.eContents().get(0);
private final RuleCall cENDDEFTerminalRuleCall_2 = (RuleCall)cGroup.eContents().get(2);
//WMLMacroDefine:
// name=DEFINE (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine |
// Textdomains+=WMLTextdomain | Values+=WMLValue)* ENDDEF;
// Textdomains+=WMLTextdomain | Values+=WMLValue | IfDefs+=WMLPreprocIF)* ENDDEF;
public ParserRule getRule() { return rule; }
//name=DEFINE (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine |
//Textdomains+=WMLTextdomain | Values+=WMLValue)* ENDDEF
//Textdomains+=WMLTextdomain | Values+=WMLValue | IfDefs+=WMLPreprocIF)* ENDDEF
public Group getGroup() { return cGroup; }
//name=DEFINE
@ -405,7 +438,7 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
public RuleCall getNameDEFINETerminalRuleCall_0_0() { return cNameDEFINETerminalRuleCall_0_0; }
//(Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain |
//Values+=WMLValue)*
//Values+=WMLValue | IfDefs+=WMLPreprocIF)*
public Alternatives getAlternatives_1() { return cAlternatives_1; }
//Tags+=WMLTag
@ -444,10 +477,129 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
//WMLValue
public RuleCall getValuesWMLValueParserRuleCall_1_5_0() { return cValuesWMLValueParserRuleCall_1_5_0; }
//IfDefs+=WMLPreprocIF
public Assignment getIfDefsAssignment_1_6() { return cIfDefsAssignment_1_6; }
//WMLPreprocIF
public RuleCall getIfDefsWMLPreprocIFParserRuleCall_1_6_0() { return cIfDefsWMLPreprocIFParserRuleCall_1_6_0; }
//ENDDEF
public RuleCall getENDDEFTerminalRuleCall_2() { return cENDDEFTerminalRuleCall_2; }
}
public class WMLPreprocIFElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "WMLPreprocIF");
private final Group cGroup = (Group)rule.eContents().get(1);
private final Assignment cNameAssignment_0 = (Assignment)cGroup.eContents().get(0);
private final Alternatives cNameAlternatives_0_0 = (Alternatives)cNameAssignment_0.eContents().get(0);
private final RuleCall cNameIFDEFTerminalRuleCall_0_0_0 = (RuleCall)cNameAlternatives_0_0.eContents().get(0);
private final RuleCall cNameIFNDEFTerminalRuleCall_0_0_1 = (RuleCall)cNameAlternatives_0_0.eContents().get(1);
private final RuleCall cNameIFHAVETerminalRuleCall_0_0_2 = (RuleCall)cNameAlternatives_0_0.eContents().get(2);
private final RuleCall cNameIFNHAVETerminalRuleCall_0_0_3 = (RuleCall)cNameAlternatives_0_0.eContents().get(3);
private final Alternatives cAlternatives_1 = (Alternatives)cGroup.eContents().get(1);
private final Assignment cTagsAssignment_1_0 = (Assignment)cAlternatives_1.eContents().get(0);
private final RuleCall cTagsWMLTagParserRuleCall_1_0_0 = (RuleCall)cTagsAssignment_1_0.eContents().get(0);
private final Assignment cKeysAssignment_1_1 = (Assignment)cAlternatives_1.eContents().get(1);
private final RuleCall cKeysWMLKeyParserRuleCall_1_1_0 = (RuleCall)cKeysAssignment_1_1.eContents().get(0);
private final Assignment cMacroCallsAssignment_1_2 = (Assignment)cAlternatives_1.eContents().get(2);
private final RuleCall cMacroCallsWMLMacroCallParserRuleCall_1_2_0 = (RuleCall)cMacroCallsAssignment_1_2.eContents().get(0);
private final Assignment cMacroDefinesAssignment_1_3 = (Assignment)cAlternatives_1.eContents().get(3);
private final RuleCall cMacroDefinesWMLMacroDefineParserRuleCall_1_3_0 = (RuleCall)cMacroDefinesAssignment_1_3.eContents().get(0);
private final Assignment cTextdomainsAssignment_1_4 = (Assignment)cAlternatives_1.eContents().get(4);
private final RuleCall cTextdomainsWMLTextdomainParserRuleCall_1_4_0 = (RuleCall)cTextdomainsAssignment_1_4.eContents().get(0);
private final Assignment cValuesAssignment_1_5 = (Assignment)cAlternatives_1.eContents().get(5);
private final RuleCall cValuesWMLValueParserRuleCall_1_5_0 = (RuleCall)cValuesAssignment_1_5.eContents().get(0);
private final Assignment cIfDefsAssignment_1_6 = (Assignment)cAlternatives_1.eContents().get(6);
private final RuleCall cIfDefsWMLPreprocIFParserRuleCall_1_6_0 = (RuleCall)cIfDefsAssignment_1_6.eContents().get(0);
private final Assignment cElsesAssignment_1_7 = (Assignment)cAlternatives_1.eContents().get(7);
private final RuleCall cElsesELSETerminalRuleCall_1_7_0 = (RuleCall)cElsesAssignment_1_7.eContents().get(0);
private final RuleCall cENDIFTerminalRuleCall_2 = (RuleCall)cGroup.eContents().get(2);
//WMLPreprocIF:
// name=(IFDEF | IFNDEF | IFHAVE | IFNHAVE) (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall |
// MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain | Values+=WMLValue | IfDefs+=WMLPreprocIF | Elses+=ELSE)*
// ENDIF;
public ParserRule getRule() { return rule; }
//name=(IFDEF | IFNDEF | IFHAVE | IFNHAVE) (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall |
//MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain | Values+=WMLValue | IfDefs+=WMLPreprocIF | Elses+=ELSE)*
//ENDIF
public Group getGroup() { return cGroup; }
//name=(IFDEF | IFNDEF | IFHAVE | IFNHAVE)
public Assignment getNameAssignment_0() { return cNameAssignment_0; }
//IFDEF | IFNDEF | IFHAVE | IFNHAVE
public Alternatives getNameAlternatives_0_0() { return cNameAlternatives_0_0; }
//IFDEF
public RuleCall getNameIFDEFTerminalRuleCall_0_0_0() { return cNameIFDEFTerminalRuleCall_0_0_0; }
//IFNDEF
public RuleCall getNameIFNDEFTerminalRuleCall_0_0_1() { return cNameIFNDEFTerminalRuleCall_0_0_1; }
//IFHAVE
public RuleCall getNameIFHAVETerminalRuleCall_0_0_2() { return cNameIFHAVETerminalRuleCall_0_0_2; }
//IFNHAVE
public RuleCall getNameIFNHAVETerminalRuleCall_0_0_3() { return cNameIFNHAVETerminalRuleCall_0_0_3; }
//(Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain |
//Values+=WMLValue | IfDefs+=WMLPreprocIF | Elses+=ELSE)*
public Alternatives getAlternatives_1() { return cAlternatives_1; }
//Tags+=WMLTag
public Assignment getTagsAssignment_1_0() { return cTagsAssignment_1_0; }
//WMLTag
public RuleCall getTagsWMLTagParserRuleCall_1_0_0() { return cTagsWMLTagParserRuleCall_1_0_0; }
//Keys+=WMLKey
public Assignment getKeysAssignment_1_1() { return cKeysAssignment_1_1; }
//WMLKey
public RuleCall getKeysWMLKeyParserRuleCall_1_1_0() { return cKeysWMLKeyParserRuleCall_1_1_0; }
//MacroCalls+=WMLMacroCall
public Assignment getMacroCallsAssignment_1_2() { return cMacroCallsAssignment_1_2; }
//WMLMacroCall
public RuleCall getMacroCallsWMLMacroCallParserRuleCall_1_2_0() { return cMacroCallsWMLMacroCallParserRuleCall_1_2_0; }
//MacroDefines+=WMLMacroDefine
public Assignment getMacroDefinesAssignment_1_3() { return cMacroDefinesAssignment_1_3; }
//WMLMacroDefine
public RuleCall getMacroDefinesWMLMacroDefineParserRuleCall_1_3_0() { return cMacroDefinesWMLMacroDefineParserRuleCall_1_3_0; }
//Textdomains+=WMLTextdomain
public Assignment getTextdomainsAssignment_1_4() { return cTextdomainsAssignment_1_4; }
//WMLTextdomain
public RuleCall getTextdomainsWMLTextdomainParserRuleCall_1_4_0() { return cTextdomainsWMLTextdomainParserRuleCall_1_4_0; }
//Values+=WMLValue
public Assignment getValuesAssignment_1_5() { return cValuesAssignment_1_5; }
//WMLValue
public RuleCall getValuesWMLValueParserRuleCall_1_5_0() { return cValuesWMLValueParserRuleCall_1_5_0; }
//IfDefs+=WMLPreprocIF
public Assignment getIfDefsAssignment_1_6() { return cIfDefsAssignment_1_6; }
//WMLPreprocIF
public RuleCall getIfDefsWMLPreprocIFParserRuleCall_1_6_0() { return cIfDefsWMLPreprocIFParserRuleCall_1_6_0; }
//Elses+=ELSE
public Assignment getElsesAssignment_1_7() { return cElsesAssignment_1_7; }
//ELSE
public RuleCall getElsesELSETerminalRuleCall_1_7_0() { return cElsesELSETerminalRuleCall_1_7_0; }
//ENDIF
public RuleCall getENDIFTerminalRuleCall_2() { return cENDIFTerminalRuleCall_2; }
}
public class WMLTextdomainElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "WMLTextdomain");
private final Assignment cNameAssignment = (Assignment)rule.eContents().get(1);
@ -474,18 +626,20 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
private final RuleCall cValueSTRINGTerminalRuleCall_0_3 = (RuleCall)cValueAlternatives_0.eContents().get(3);
private final Keyword cValueTildeKeyword_0_4 = (Keyword)cValueAlternatives_0.eContents().get(4);
private final Keyword cValueFullStopKeyword_0_5 = (Keyword)cValueAlternatives_0.eContents().get(5);
private final Keyword cValueLeftParenthesisKeyword_0_6 = (Keyword)cValueAlternatives_0.eContents().get(6);
private final Keyword cValueRightParenthesisKeyword_0_7 = (Keyword)cValueAlternatives_0.eContents().get(7);
private final RuleCall cValueANY_OTHERTerminalRuleCall_0_8 = (RuleCall)cValueAlternatives_0.eContents().get(8);
private final Keyword cValueDollarSignKeyword_0_6 = (Keyword)cValueAlternatives_0.eContents().get(6);
private final Keyword cValueSolidusKeyword_0_7 = (Keyword)cValueAlternatives_0.eContents().get(7);
private final Keyword cValueLeftParenthesisKeyword_0_8 = (Keyword)cValueAlternatives_0.eContents().get(8);
private final Keyword cValueRightParenthesisKeyword_0_9 = (Keyword)cValueAlternatives_0.eContents().get(9);
private final RuleCall cValueANY_OTHERTerminalRuleCall_0_10 = (RuleCall)cValueAlternatives_0.eContents().get(10);
//WMLValue:
// value=(ID | TSTRING | TVAR | STRING | "~" | "." | "(" | ")" | ANY_OTHER);
// value=(ID | TSTRING | TVAR | STRING | "~" | "." | "$" | "/" | "(" | ")" | ANY_OTHER);
public ParserRule getRule() { return rule; }
//value=(ID | TSTRING | TVAR | STRING | "~" | "." | "(" | ")" | ANY_OTHER)
//value=(ID | TSTRING | TVAR | STRING | "~" | "." | "$" | "/" | "(" | ")" | ANY_OTHER)
public Assignment getValueAssignment() { return cValueAssignment; }
//ID | TSTRING | TVAR | STRING | "~" | "." | "(" | ")" | ANY_OTHER
//ID | TSTRING | TVAR | STRING | "~" | "." | "$" | "/" | "(" | ")" | ANY_OTHER
public Alternatives getValueAlternatives_0() { return cValueAlternatives_0; }
//ID
@ -506,14 +660,20 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
//"."
public Keyword getValueFullStopKeyword_0_5() { return cValueFullStopKeyword_0_5; }
//"$"
public Keyword getValueDollarSignKeyword_0_6() { return cValueDollarSignKeyword_0_6; }
//"/"
public Keyword getValueSolidusKeyword_0_7() { return cValueSolidusKeyword_0_7; }
//"("
public Keyword getValueLeftParenthesisKeyword_0_6() { return cValueLeftParenthesisKeyword_0_6; }
public Keyword getValueLeftParenthesisKeyword_0_8() { return cValueLeftParenthesisKeyword_0_8; }
//")"
public Keyword getValueRightParenthesisKeyword_0_7() { return cValueRightParenthesisKeyword_0_7; }
public Keyword getValueRightParenthesisKeyword_0_9() { return cValueRightParenthesisKeyword_0_9; }
//ANY_OTHER
public RuleCall getValueANY_OTHERTerminalRuleCall_0_8() { return cValueANY_OTHERTerminalRuleCall_0_8; }
public RuleCall getValueANY_OTHERTerminalRuleCall_0_10() { return cValueANY_OTHERTerminalRuleCall_0_10; }
}
public class TSTRINGElements extends AbstractParserRuleElementFinder {
@ -595,12 +755,19 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
private WMLLuaCodeElements pWMLLuaCode;
private WMLArrayCallElements pWMLArrayCall;
private WMLMacroDefineElements pWMLMacroDefine;
private WMLPreprocIFElements pWMLPreprocIF;
private WMLTextdomainElements pWMLTextdomain;
private WMLValueElements pWMLValue;
private TSTRINGElements pTSTRING;
private TVARElements pTVAR;
private MacroTokensElements pMacroTokens;
private TerminalRule tLUA_CODE;
private TerminalRule tIFHAVE;
private TerminalRule tIFNHAVE;
private TerminalRule tIFDEF;
private TerminalRule tIFNDEF;
private TerminalRule tELSE;
private TerminalRule tENDIF;
private TerminalRule tDEFINE;
private TerminalRule tENDDEF;
private TerminalRule tTEXTDOMAIN;
@ -628,7 +795,8 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
////handles TODO:
//// - preprocessor commands: #define, #enddef, etc
//WMLRoot:
// (Tags+=WMLTag | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain)*;
// (Tags+=WMLTag | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain |
// IfDefs+=WMLPreprocIF)*;
public WMLRootElements getWMLRootAccess() {
return (pWMLRoot != null) ? pWMLRoot : (pWMLRoot = new WMLRootElements());
}
@ -639,7 +807,7 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
//WMLTag:
// "[" plus?="+"? name=ID "]" (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine |
// Textdomains+=WMLTextdomain)* "[/" endName=ID "]";
// Textdomains+=WMLTextdomain | IfDefs+=WMLPreprocIF)* "[/" endName=ID "]";
public WMLTagElements getWMLTagAccess() {
return (pWMLTag != null) ? pWMLTag : (pWMLTag = new WMLTagElements());
}
@ -649,7 +817,7 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
}
//WMLKey hidden(WS):
// name=ID "=" value+=WMLKeyValue* (EOL? "+" EOL? value+=WMLKeyValue)* (EOL | SL_COMMENT);
// name=ID "=" value+=WMLKeyValue* (EOL? "+" EOL? value+=WMLKeyValue+)* (EOL | SL_COMMENT);
public WMLKeyElements getWMLKeyAccess() {
return (pWMLKey != null) ? pWMLKey : (pWMLKey = new WMLKeyElements());
}
@ -669,7 +837,7 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
}
//WMLMacroCall:
// "{" "./"? relative?="~"? name=ID (params+=(WMLValue | MacroTokens) | extraMacros+=WMLMacroCall)* "}";
// "{" (point?="." "/")? relative?="~"? name=ID (params+=(WMLValue | MacroTokens) | extraMacros+=WMLMacroCall)* "}";
public WMLMacroCallElements getWMLMacroCallAccess() {
return (pWMLMacroCall != null) ? pWMLMacroCall : (pWMLMacroCall = new WMLMacroCallElements());
}
@ -700,7 +868,7 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
//WMLMacroDefine:
// name=DEFINE (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall | MacroDefines+=WMLMacroDefine |
// Textdomains+=WMLTextdomain | Values+=WMLValue)* ENDDEF;
// Textdomains+=WMLTextdomain | Values+=WMLValue | IfDefs+=WMLPreprocIF)* ENDDEF;
public WMLMacroDefineElements getWMLMacroDefineAccess() {
return (pWMLMacroDefine != null) ? pWMLMacroDefine : (pWMLMacroDefine = new WMLMacroDefineElements());
}
@ -709,6 +877,18 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
return getWMLMacroDefineAccess().getRule();
}
//WMLPreprocIF:
// name=(IFDEF | IFNDEF | IFHAVE | IFNHAVE) (Tags+=WMLTag | Keys+=WMLKey | MacroCalls+=WMLMacroCall |
// MacroDefines+=WMLMacroDefine | Textdomains+=WMLTextdomain | Values+=WMLValue | IfDefs+=WMLPreprocIF | Elses+=ELSE)*
// ENDIF;
public WMLPreprocIFElements getWMLPreprocIFAccess() {
return (pWMLPreprocIF != null) ? pWMLPreprocIF : (pWMLPreprocIF = new WMLPreprocIFElements());
}
public ParserRule getWMLPreprocIFRule() {
return getWMLPreprocIFAccess().getRule();
}
//WMLTextdomain:
// name=TEXTDOMAIN;
public WMLTextdomainElements getWMLTextdomainAccess() {
@ -720,7 +900,7 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
}
//WMLValue:
// value=(ID | TSTRING | TVAR | STRING | "~" | "." | "(" | ")" | ANY_OTHER);
// value=(ID | TSTRING | TVAR | STRING | "~" | "." | "$" | "/" | "(" | ")" | ANY_OTHER);
public WMLValueElements getWMLValueAccess() {
return (pWMLValue != null) ? pWMLValue : (pWMLValue = new WMLValueElements());
}
@ -767,6 +947,43 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
return (tLUA_CODE != null) ? tLUA_CODE : (tLUA_CODE = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "LUA_CODE"));
}
//// Preprocessor terminals
//terminal IFHAVE:
// "#ifhave" !("\n" | "\r")* ("\r"? "\n")?;
public TerminalRule getIFHAVERule() {
return (tIFHAVE != null) ? tIFHAVE : (tIFHAVE = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "IFHAVE"));
}
//terminal IFNHAVE:
// "#ifnhave" !("\n" | "\r")* ("\r"? "\n")?;
public TerminalRule getIFNHAVERule() {
return (tIFNHAVE != null) ? tIFNHAVE : (tIFNHAVE = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "IFNHAVE"));
}
//terminal IFDEF:
// "#ifdef" !("\n" | "\r")* ("\r"? "\n")?;
public TerminalRule getIFDEFRule() {
return (tIFDEF != null) ? tIFDEF : (tIFDEF = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "IFDEF"));
}
//terminal IFNDEF:
// "#ifndef" !("\n" | "\r")* ("\r"? "\n")?;
public TerminalRule getIFNDEFRule() {
return (tIFNDEF != null) ? tIFNDEF : (tIFNDEF = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "IFNDEF"));
}
//terminal ELSE:
// "#else" !("\n" | "\r")* ("\r"? "\n")?;
public TerminalRule getELSERule() {
return (tELSE != null) ? tELSE : (tELSE = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "ELSE"));
}
//terminal ENDIF:
// "#endif" !("\n" | "\r")* ("\r"? "\n")?;
public TerminalRule getENDIFRule() {
return (tENDIF != null) ? tENDIF : (tENDIF = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "ENDIF"));
}
//terminal DEFINE:
// "#define" !("\n" | "\r")* ("\r"? "\n")?;
public TerminalRule getDEFINERule() {
@ -785,6 +1002,7 @@ public class WMLGrammarAccess extends AbstractGrammarElementFinder {
return (tTEXTDOMAIN != null) ? tTEXTDOMAIN : (tTEXTDOMAIN = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "TEXTDOMAIN"));
}
//// end preprocessor terminals
//terminal STRING:
// "\"" ("\\" ("b" | "t" | "n" | "f" | "r" | "\"" | "\'" | "\\") | !("\\" | "\""))* "\"";
public TerminalRule getSTRINGRule() {

View file

@ -98,6 +98,15 @@ public interface WMLFactory extends EFactory
*/
WMLMacroDefine createWMLMacroDefine();
/**
* Returns a new object of class '<em>Preproc IF</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Preproc IF</em>'.
* @generated
*/
WMLPreprocIF createWMLPreprocIF();
/**
* Returns a new object of class '<em>Textdomain</em>'.
* <!-- begin-user-doc -->

View file

@ -18,6 +18,7 @@ import org.eclipse.emf.ecore.EObject;
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.wesnoth.wML.WMLMacroCall#isPoint <em>Point</em>}</li>
* <li>{@link org.wesnoth.wML.WMLMacroCall#isRelative <em>Relative</em>}</li>
* <li>{@link org.wesnoth.wML.WMLMacroCall#getName <em>Name</em>}</li>
* <li>{@link org.wesnoth.wML.WMLMacroCall#getParams <em>Params</em>}</li>
@ -31,6 +32,32 @@ import org.eclipse.emf.ecore.EObject;
*/
public interface WMLMacroCall extends WMLKeyValue
{
/**
* Returns the value of the '<em><b>Point</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Point</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Point</em>' attribute.
* @see #setPoint(boolean)
* @see org.wesnoth.wML.WMLPackage#getWMLMacroCall_Point()
* @model
* @generated
*/
boolean isPoint();
/**
* Sets the value of the '{@link org.wesnoth.wML.WMLMacroCall#isPoint <em>Point</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Point</em>' attribute.
* @see #isPoint()
* @generated
*/
void setPoint(boolean value);
/**
* Returns the value of the '<em><b>Relative</b></em>' attribute.
* <!-- begin-user-doc -->

View file

@ -25,6 +25,7 @@ import org.eclipse.emf.ecore.EObject;
* <li>{@link org.wesnoth.wML.WMLMacroDefine#getMacroDefines <em>Macro Defines</em>}</li>
* <li>{@link org.wesnoth.wML.WMLMacroDefine#getTextdomains <em>Textdomains</em>}</li>
* <li>{@link org.wesnoth.wML.WMLMacroDefine#getValues <em>Values</em>}</li>
* <li>{@link org.wesnoth.wML.WMLMacroDefine#getIfDefs <em>If Defs</em>}</li>
* </ul>
* </p>
*
@ -156,4 +157,20 @@ public interface WMLMacroDefine extends EObject
*/
EList<WMLValue> getValues();
/**
* Returns the value of the '<em><b>If Defs</b></em>' containment reference list.
* The list contents are of type {@link org.wesnoth.wML.WMLPreprocIF}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>If Defs</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>If Defs</em>' containment reference list.
* @see org.wesnoth.wML.WMLPackage#getWMLMacroDefine_IfDefs()
* @model containment="true"
* @generated
*/
EList<WMLPreprocIF> getIfDefs();
} // WMLMacroDefine

View file

@ -106,6 +106,15 @@ public interface WMLPackage extends EPackage
*/
int WML_ROOT__TEXTDOMAINS = 3;
/**
* The feature id for the '<em><b>If Defs</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int WML_ROOT__IF_DEFS = 4;
/**
* The number of structural features of the '<em>Root</em>' class.
* <!-- begin-user-doc -->
@ -113,7 +122,7 @@ public interface WMLPackage extends EPackage
* @generated
* @ordered
*/
int WML_ROOT_FEATURE_COUNT = 4;
int WML_ROOT_FEATURE_COUNT = 5;
/**
* The meta object id for the '{@link org.wesnoth.wML.impl.WMLTagImpl <em>Tag</em>}' class.
@ -188,6 +197,15 @@ public interface WMLPackage extends EPackage
*/
int WML_TAG__TEXTDOMAINS = 6;
/**
* The feature id for the '<em><b>If Defs</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int WML_TAG__IF_DEFS = 7;
/**
* The feature id for the '<em><b>End Name</b></em>' attribute.
* <!-- begin-user-doc -->
@ -195,7 +213,7 @@ public interface WMLPackage extends EPackage
* @generated
* @ordered
*/
int WML_TAG__END_NAME = 7;
int WML_TAG__END_NAME = 8;
/**
* The number of structural features of the '<em>Tag</em>' class.
@ -204,7 +222,7 @@ public interface WMLPackage extends EPackage
* @generated
* @ordered
*/
int WML_TAG_FEATURE_COUNT = 8;
int WML_TAG_FEATURE_COUNT = 9;
/**
* The meta object id for the '{@link org.wesnoth.wML.impl.WMLKeyImpl <em>Key</em>}' class.
@ -272,6 +290,15 @@ public interface WMLPackage extends EPackage
*/
int WML_MACRO_CALL = 4;
/**
* The feature id for the '<em><b>Point</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int WML_MACRO_CALL__POINT = WML_KEY_VALUE_FEATURE_COUNT + 0;
/**
* The feature id for the '<em><b>Relative</b></em>' attribute.
* <!-- begin-user-doc -->
@ -279,7 +306,7 @@ public interface WMLPackage extends EPackage
* @generated
* @ordered
*/
int WML_MACRO_CALL__RELATIVE = WML_KEY_VALUE_FEATURE_COUNT + 0;
int WML_MACRO_CALL__RELATIVE = WML_KEY_VALUE_FEATURE_COUNT + 1;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@ -288,7 +315,7 @@ public interface WMLPackage extends EPackage
* @generated
* @ordered
*/
int WML_MACRO_CALL__NAME = WML_KEY_VALUE_FEATURE_COUNT + 1;
int WML_MACRO_CALL__NAME = WML_KEY_VALUE_FEATURE_COUNT + 2;
/**
* The feature id for the '<em><b>Params</b></em>' containment reference list.
@ -297,7 +324,7 @@ public interface WMLPackage extends EPackage
* @generated
* @ordered
*/
int WML_MACRO_CALL__PARAMS = WML_KEY_VALUE_FEATURE_COUNT + 2;
int WML_MACRO_CALL__PARAMS = WML_KEY_VALUE_FEATURE_COUNT + 3;
/**
* The feature id for the '<em><b>Extra Macros</b></em>' containment reference list.
@ -306,7 +333,7 @@ public interface WMLPackage extends EPackage
* @generated
* @ordered
*/
int WML_MACRO_CALL__EXTRA_MACROS = WML_KEY_VALUE_FEATURE_COUNT + 3;
int WML_MACRO_CALL__EXTRA_MACROS = WML_KEY_VALUE_FEATURE_COUNT + 4;
/**
* The number of structural features of the '<em>Macro Call</em>' class.
@ -315,7 +342,7 @@ public interface WMLPackage extends EPackage
* @generated
* @ordered
*/
int WML_MACRO_CALL_FEATURE_COUNT = WML_KEY_VALUE_FEATURE_COUNT + 4;
int WML_MACRO_CALL_FEATURE_COUNT = WML_KEY_VALUE_FEATURE_COUNT + 5;
/**
* The meta object id for the '{@link org.wesnoth.wML.impl.WMLLuaCodeImpl <em>Lua Code</em>}' class.
@ -446,6 +473,15 @@ public interface WMLPackage extends EPackage
*/
int WML_MACRO_DEFINE__VALUES = 6;
/**
* The feature id for the '<em><b>If Defs</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int WML_MACRO_DEFINE__IF_DEFS = 7;
/**
* The number of structural features of the '<em>Macro Define</em>' class.
* <!-- begin-user-doc -->
@ -453,7 +489,107 @@ public interface WMLPackage extends EPackage
* @generated
* @ordered
*/
int WML_MACRO_DEFINE_FEATURE_COUNT = 7;
int WML_MACRO_DEFINE_FEATURE_COUNT = 8;
/**
* The meta object id for the '{@link org.wesnoth.wML.impl.WMLPreprocIFImpl <em>Preproc IF</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.wesnoth.wML.impl.WMLPreprocIFImpl
* @see org.wesnoth.wML.impl.WMLPackageImpl#getWMLPreprocIF()
* @generated
*/
int WML_PREPROC_IF = 8;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int WML_PREPROC_IF__NAME = 0;
/**
* The feature id for the '<em><b>Tags</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int WML_PREPROC_IF__TAGS = 1;
/**
* The feature id for the '<em><b>Keys</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int WML_PREPROC_IF__KEYS = 2;
/**
* The feature id for the '<em><b>Macro Calls</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int WML_PREPROC_IF__MACRO_CALLS = 3;
/**
* The feature id for the '<em><b>Macro Defines</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int WML_PREPROC_IF__MACRO_DEFINES = 4;
/**
* The feature id for the '<em><b>Textdomains</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int WML_PREPROC_IF__TEXTDOMAINS = 5;
/**
* The feature id for the '<em><b>Values</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int WML_PREPROC_IF__VALUES = 6;
/**
* The feature id for the '<em><b>If Defs</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int WML_PREPROC_IF__IF_DEFS = 7;
/**
* The feature id for the '<em><b>Elses</b></em>' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int WML_PREPROC_IF__ELSES = 8;
/**
* The number of structural features of the '<em>Preproc IF</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int WML_PREPROC_IF_FEATURE_COUNT = 9;
/**
* The meta object id for the '{@link org.wesnoth.wML.impl.WMLTextdomainImpl <em>Textdomain</em>}' class.
@ -463,7 +599,7 @@ public interface WMLPackage extends EPackage
* @see org.wesnoth.wML.impl.WMLPackageImpl#getWMLTextdomain()
* @generated
*/
int WML_TEXTDOMAIN = 8;
int WML_TEXTDOMAIN = 9;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@ -491,7 +627,7 @@ public interface WMLPackage extends EPackage
* @see org.wesnoth.wML.impl.WMLPackageImpl#getWMLValue()
* @generated
*/
int WML_VALUE = 9;
int WML_VALUE = 10;
/**
* The feature id for the '<em><b>Value</b></em>' attribute.
@ -519,7 +655,7 @@ public interface WMLPackage extends EPackage
* @see org.wesnoth.wML.impl.WMLPackageImpl#getMacroTokens()
* @generated
*/
int MACRO_TOKENS = 10;
int MACRO_TOKENS = 11;
/**
* The feature id for the '<em><b>Val</b></em>' attribute.
@ -594,6 +730,17 @@ public interface WMLPackage extends EPackage
*/
EReference getWMLRoot_Textdomains();
/**
* Returns the meta object for the containment reference list '{@link org.wesnoth.wML.WMLRoot#getIfDefs <em>If Defs</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>If Defs</em>'.
* @see org.wesnoth.wML.WMLRoot#getIfDefs()
* @see #getWMLRoot()
* @generated
*/
EReference getWMLRoot_IfDefs();
/**
* Returns the meta object for class '{@link org.wesnoth.wML.WMLTag <em>Tag</em>}'.
* <!-- begin-user-doc -->
@ -681,6 +828,17 @@ public interface WMLPackage extends EPackage
*/
EReference getWMLTag_Textdomains();
/**
* Returns the meta object for the containment reference list '{@link org.wesnoth.wML.WMLTag#getIfDefs <em>If Defs</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>If Defs</em>'.
* @see org.wesnoth.wML.WMLTag#getIfDefs()
* @see #getWMLTag()
* @generated
*/
EReference getWMLTag_IfDefs();
/**
* Returns the meta object for the attribute '{@link org.wesnoth.wML.WMLTag#getEndName <em>End Name</em>}'.
* <!-- begin-user-doc -->
@ -744,6 +902,17 @@ public interface WMLPackage extends EPackage
*/
EClass getWMLMacroCall();
/**
* Returns the meta object for the attribute '{@link org.wesnoth.wML.WMLMacroCall#isPoint <em>Point</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Point</em>'.
* @see org.wesnoth.wML.WMLMacroCall#isPoint()
* @see #getWMLMacroCall()
* @generated
*/
EAttribute getWMLMacroCall_Point();
/**
* Returns the meta object for the attribute '{@link org.wesnoth.wML.WMLMacroCall#isRelative <em>Relative</em>}'.
* <!-- begin-user-doc -->
@ -917,6 +1086,126 @@ public interface WMLPackage extends EPackage
*/
EReference getWMLMacroDefine_Values();
/**
* Returns the meta object for the containment reference list '{@link org.wesnoth.wML.WMLMacroDefine#getIfDefs <em>If Defs</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>If Defs</em>'.
* @see org.wesnoth.wML.WMLMacroDefine#getIfDefs()
* @see #getWMLMacroDefine()
* @generated
*/
EReference getWMLMacroDefine_IfDefs();
/**
* Returns the meta object for class '{@link org.wesnoth.wML.WMLPreprocIF <em>Preproc IF</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Preproc IF</em>'.
* @see org.wesnoth.wML.WMLPreprocIF
* @generated
*/
EClass getWMLPreprocIF();
/**
* Returns the meta object for the attribute '{@link org.wesnoth.wML.WMLPreprocIF#getName <em>Name</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Name</em>'.
* @see org.wesnoth.wML.WMLPreprocIF#getName()
* @see #getWMLPreprocIF()
* @generated
*/
EAttribute getWMLPreprocIF_Name();
/**
* Returns the meta object for the containment reference list '{@link org.wesnoth.wML.WMLPreprocIF#getTags <em>Tags</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Tags</em>'.
* @see org.wesnoth.wML.WMLPreprocIF#getTags()
* @see #getWMLPreprocIF()
* @generated
*/
EReference getWMLPreprocIF_Tags();
/**
* Returns the meta object for the containment reference list '{@link org.wesnoth.wML.WMLPreprocIF#getKeys <em>Keys</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Keys</em>'.
* @see org.wesnoth.wML.WMLPreprocIF#getKeys()
* @see #getWMLPreprocIF()
* @generated
*/
EReference getWMLPreprocIF_Keys();
/**
* Returns the meta object for the containment reference list '{@link org.wesnoth.wML.WMLPreprocIF#getMacroCalls <em>Macro Calls</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Macro Calls</em>'.
* @see org.wesnoth.wML.WMLPreprocIF#getMacroCalls()
* @see #getWMLPreprocIF()
* @generated
*/
EReference getWMLPreprocIF_MacroCalls();
/**
* Returns the meta object for the containment reference list '{@link org.wesnoth.wML.WMLPreprocIF#getMacroDefines <em>Macro Defines</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Macro Defines</em>'.
* @see org.wesnoth.wML.WMLPreprocIF#getMacroDefines()
* @see #getWMLPreprocIF()
* @generated
*/
EReference getWMLPreprocIF_MacroDefines();
/**
* Returns the meta object for the containment reference list '{@link org.wesnoth.wML.WMLPreprocIF#getTextdomains <em>Textdomains</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Textdomains</em>'.
* @see org.wesnoth.wML.WMLPreprocIF#getTextdomains()
* @see #getWMLPreprocIF()
* @generated
*/
EReference getWMLPreprocIF_Textdomains();
/**
* Returns the meta object for the containment reference list '{@link org.wesnoth.wML.WMLPreprocIF#getValues <em>Values</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Values</em>'.
* @see org.wesnoth.wML.WMLPreprocIF#getValues()
* @see #getWMLPreprocIF()
* @generated
*/
EReference getWMLPreprocIF_Values();
/**
* Returns the meta object for the containment reference list '{@link org.wesnoth.wML.WMLPreprocIF#getIfDefs <em>If Defs</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>If Defs</em>'.
* @see org.wesnoth.wML.WMLPreprocIF#getIfDefs()
* @see #getWMLPreprocIF()
* @generated
*/
EReference getWMLPreprocIF_IfDefs();
/**
* Returns the meta object for the attribute list '{@link org.wesnoth.wML.WMLPreprocIF#getElses <em>Elses</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute list '<em>Elses</em>'.
* @see org.wesnoth.wML.WMLPreprocIF#getElses()
* @see #getWMLPreprocIF()
* @generated
*/
EAttribute getWMLPreprocIF_Elses();
/**
* Returns the meta object for class '{@link org.wesnoth.wML.WMLTextdomain <em>Textdomain</em>}'.
* <!-- begin-user-doc -->
@ -1045,6 +1334,14 @@ public interface WMLPackage extends EPackage
*/
EReference WML_ROOT__TEXTDOMAINS = eINSTANCE.getWMLRoot_Textdomains();
/**
* The meta object literal for the '<em><b>If Defs</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference WML_ROOT__IF_DEFS = eINSTANCE.getWMLRoot_IfDefs();
/**
* The meta object literal for the '{@link org.wesnoth.wML.impl.WMLTagImpl <em>Tag</em>}' class.
* <!-- begin-user-doc -->
@ -1111,6 +1408,14 @@ public interface WMLPackage extends EPackage
*/
EReference WML_TAG__TEXTDOMAINS = eINSTANCE.getWMLTag_Textdomains();
/**
* The meta object literal for the '<em><b>If Defs</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference WML_TAG__IF_DEFS = eINSTANCE.getWMLTag_IfDefs();
/**
* The meta object literal for the '<em><b>End Name</b></em>' attribute feature.
* <!-- begin-user-doc -->
@ -1165,6 +1470,14 @@ public interface WMLPackage extends EPackage
*/
EClass WML_MACRO_CALL = eINSTANCE.getWMLMacroCall();
/**
* The meta object literal for the '<em><b>Point</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute WML_MACRO_CALL__POINT = eINSTANCE.getWMLMacroCall_Point();
/**
* The meta object literal for the '<em><b>Relative</b></em>' attribute feature.
* <!-- begin-user-doc -->
@ -1299,6 +1612,96 @@ public interface WMLPackage extends EPackage
*/
EReference WML_MACRO_DEFINE__VALUES = eINSTANCE.getWMLMacroDefine_Values();
/**
* The meta object literal for the '<em><b>If Defs</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference WML_MACRO_DEFINE__IF_DEFS = eINSTANCE.getWMLMacroDefine_IfDefs();
/**
* The meta object literal for the '{@link org.wesnoth.wML.impl.WMLPreprocIFImpl <em>Preproc IF</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.wesnoth.wML.impl.WMLPreprocIFImpl
* @see org.wesnoth.wML.impl.WMLPackageImpl#getWMLPreprocIF()
* @generated
*/
EClass WML_PREPROC_IF = eINSTANCE.getWMLPreprocIF();
/**
* The meta object literal for the '<em><b>Name</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute WML_PREPROC_IF__NAME = eINSTANCE.getWMLPreprocIF_Name();
/**
* The meta object literal for the '<em><b>Tags</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference WML_PREPROC_IF__TAGS = eINSTANCE.getWMLPreprocIF_Tags();
/**
* The meta object literal for the '<em><b>Keys</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference WML_PREPROC_IF__KEYS = eINSTANCE.getWMLPreprocIF_Keys();
/**
* The meta object literal for the '<em><b>Macro Calls</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference WML_PREPROC_IF__MACRO_CALLS = eINSTANCE.getWMLPreprocIF_MacroCalls();
/**
* The meta object literal for the '<em><b>Macro Defines</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference WML_PREPROC_IF__MACRO_DEFINES = eINSTANCE.getWMLPreprocIF_MacroDefines();
/**
* The meta object literal for the '<em><b>Textdomains</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference WML_PREPROC_IF__TEXTDOMAINS = eINSTANCE.getWMLPreprocIF_Textdomains();
/**
* The meta object literal for the '<em><b>Values</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference WML_PREPROC_IF__VALUES = eINSTANCE.getWMLPreprocIF_Values();
/**
* The meta object literal for the '<em><b>If Defs</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference WML_PREPROC_IF__IF_DEFS = eINSTANCE.getWMLPreprocIF_IfDefs();
/**
* The meta object literal for the '<em><b>Elses</b></em>' attribute list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute WML_PREPROC_IF__ELSES = eINSTANCE.getWMLPreprocIF_Elses();
/**
* The meta object literal for the '{@link org.wesnoth.wML.impl.WMLTextdomainImpl <em>Textdomain</em>}' class.
* <!-- begin-user-doc -->

View file

@ -0,0 +1,193 @@
/**
* <copyright>
* </copyright>
*
*/
package org.wesnoth.wML;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Preproc IF</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.wesnoth.wML.WMLPreprocIF#getName <em>Name</em>}</li>
* <li>{@link org.wesnoth.wML.WMLPreprocIF#getTags <em>Tags</em>}</li>
* <li>{@link org.wesnoth.wML.WMLPreprocIF#getKeys <em>Keys</em>}</li>
* <li>{@link org.wesnoth.wML.WMLPreprocIF#getMacroCalls <em>Macro Calls</em>}</li>
* <li>{@link org.wesnoth.wML.WMLPreprocIF#getMacroDefines <em>Macro Defines</em>}</li>
* <li>{@link org.wesnoth.wML.WMLPreprocIF#getTextdomains <em>Textdomains</em>}</li>
* <li>{@link org.wesnoth.wML.WMLPreprocIF#getValues <em>Values</em>}</li>
* <li>{@link org.wesnoth.wML.WMLPreprocIF#getIfDefs <em>If Defs</em>}</li>
* <li>{@link org.wesnoth.wML.WMLPreprocIF#getElses <em>Elses</em>}</li>
* </ul>
* </p>
*
* @see org.wesnoth.wML.WMLPackage#getWMLPreprocIF()
* @model
* @generated
*/
public interface WMLPreprocIF extends EObject
{
/**
* Returns the value of the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Name</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Name</em>' attribute.
* @see #setName(String)
* @see org.wesnoth.wML.WMLPackage#getWMLPreprocIF_Name()
* @model
* @generated
*/
String getName();
/**
* Sets the value of the '{@link org.wesnoth.wML.WMLPreprocIF#getName <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Name</em>' attribute.
* @see #getName()
* @generated
*/
void setName(String value);
/**
* Returns the value of the '<em><b>Tags</b></em>' containment reference list.
* The list contents are of type {@link org.wesnoth.wML.WMLTag}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Tags</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Tags</em>' containment reference list.
* @see org.wesnoth.wML.WMLPackage#getWMLPreprocIF_Tags()
* @model containment="true"
* @generated
*/
EList<WMLTag> getTags();
/**
* Returns the value of the '<em><b>Keys</b></em>' containment reference list.
* The list contents are of type {@link org.wesnoth.wML.WMLKey}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Keys</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Keys</em>' containment reference list.
* @see org.wesnoth.wML.WMLPackage#getWMLPreprocIF_Keys()
* @model containment="true"
* @generated
*/
EList<WMLKey> getKeys();
/**
* Returns the value of the '<em><b>Macro Calls</b></em>' containment reference list.
* The list contents are of type {@link org.wesnoth.wML.WMLMacroCall}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Macro Calls</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Macro Calls</em>' containment reference list.
* @see org.wesnoth.wML.WMLPackage#getWMLPreprocIF_MacroCalls()
* @model containment="true"
* @generated
*/
EList<WMLMacroCall> getMacroCalls();
/**
* Returns the value of the '<em><b>Macro Defines</b></em>' containment reference list.
* The list contents are of type {@link org.wesnoth.wML.WMLMacroDefine}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Macro Defines</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Macro Defines</em>' containment reference list.
* @see org.wesnoth.wML.WMLPackage#getWMLPreprocIF_MacroDefines()
* @model containment="true"
* @generated
*/
EList<WMLMacroDefine> getMacroDefines();
/**
* Returns the value of the '<em><b>Textdomains</b></em>' containment reference list.
* The list contents are of type {@link org.wesnoth.wML.WMLTextdomain}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Textdomains</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Textdomains</em>' containment reference list.
* @see org.wesnoth.wML.WMLPackage#getWMLPreprocIF_Textdomains()
* @model containment="true"
* @generated
*/
EList<WMLTextdomain> getTextdomains();
/**
* Returns the value of the '<em><b>Values</b></em>' containment reference list.
* The list contents are of type {@link org.wesnoth.wML.WMLValue}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Values</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Values</em>' containment reference list.
* @see org.wesnoth.wML.WMLPackage#getWMLPreprocIF_Values()
* @model containment="true"
* @generated
*/
EList<WMLValue> getValues();
/**
* Returns the value of the '<em><b>If Defs</b></em>' containment reference list.
* The list contents are of type {@link org.wesnoth.wML.WMLPreprocIF}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>If Defs</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>If Defs</em>' containment reference list.
* @see org.wesnoth.wML.WMLPackage#getWMLPreprocIF_IfDefs()
* @model containment="true"
* @generated
*/
EList<WMLPreprocIF> getIfDefs();
/**
* Returns the value of the '<em><b>Elses</b></em>' attribute list.
* The list contents are of type {@link java.lang.String}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Elses</em>' attribute list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Elses</em>' attribute list.
* @see org.wesnoth.wML.WMLPackage#getWMLPreprocIF_Elses()
* @model unique="false"
* @generated
*/
EList<String> getElses();
} // WMLPreprocIF

View file

@ -22,6 +22,7 @@ import org.eclipse.emf.ecore.EObject;
* <li>{@link org.wesnoth.wML.WMLRoot#getMacroCalls <em>Macro Calls</em>}</li>
* <li>{@link org.wesnoth.wML.WMLRoot#getMacroDefines <em>Macro Defines</em>}</li>
* <li>{@link org.wesnoth.wML.WMLRoot#getTextdomains <em>Textdomains</em>}</li>
* <li>{@link org.wesnoth.wML.WMLRoot#getIfDefs <em>If Defs</em>}</li>
* </ul>
* </p>
*
@ -95,4 +96,20 @@ public interface WMLRoot extends EObject
*/
EList<WMLTextdomain> getTextdomains();
/**
* Returns the value of the '<em><b>If Defs</b></em>' containment reference list.
* The list contents are of type {@link org.wesnoth.wML.WMLPreprocIF}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>If Defs</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>If Defs</em>' containment reference list.
* @see org.wesnoth.wML.WMLPackage#getWMLRoot_IfDefs()
* @model containment="true"
* @generated
*/
EList<WMLPreprocIF> getIfDefs();
} // WMLRoot

View file

@ -25,6 +25,7 @@ import org.eclipse.emf.ecore.EObject;
* <li>{@link org.wesnoth.wML.WMLTag#getMacroCalls <em>Macro Calls</em>}</li>
* <li>{@link org.wesnoth.wML.WMLTag#getMacroDefines <em>Macro Defines</em>}</li>
* <li>{@link org.wesnoth.wML.WMLTag#getTextdomains <em>Textdomains</em>}</li>
* <li>{@link org.wesnoth.wML.WMLTag#getIfDefs <em>If Defs</em>}</li>
* <li>{@link org.wesnoth.wML.WMLTag#getEndName <em>End Name</em>}</li>
* </ul>
* </p>
@ -167,6 +168,22 @@ public interface WMLTag extends EObject
*/
EList<WMLTextdomain> getTextdomains();
/**
* Returns the value of the '<em><b>If Defs</b></em>' containment reference list.
* The list contents are of type {@link org.wesnoth.wML.WMLPreprocIF}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>If Defs</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>If Defs</em>' containment reference list.
* @see org.wesnoth.wML.WMLPackage#getWMLTag_IfDefs()
* @model containment="true"
* @generated
*/
EList<WMLPreprocIF> getIfDefs();
/**
* Returns the value of the '<em><b>End Name</b></em>' attribute.
* <!-- begin-user-doc -->

View file

@ -76,6 +76,7 @@ public class WMLFactoryImpl extends EFactoryImpl implements WMLFactory
case WMLPackage.WML_LUA_CODE: return createWMLLuaCode();
case WMLPackage.WML_ARRAY_CALL: return createWMLArrayCall();
case WMLPackage.WML_MACRO_DEFINE: return createWMLMacroDefine();
case WMLPackage.WML_PREPROC_IF: return createWMLPreprocIF();
case WMLPackage.WML_TEXTDOMAIN: return createWMLTextdomain();
case WMLPackage.WML_VALUE: return createWMLValue();
case WMLPackage.MACRO_TOKENS: return createMacroTokens();
@ -172,6 +173,17 @@ public class WMLFactoryImpl extends EFactoryImpl implements WMLFactory
return wmlMacroDefine;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WMLPreprocIF createWMLPreprocIF()
{
WMLPreprocIFImpl wmlPreprocIF = new WMLPreprocIFImpl();
return wmlPreprocIF;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->

View file

@ -32,6 +32,7 @@ import org.wesnoth.wML.WMLPackage;
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.wesnoth.wML.impl.WMLMacroCallImpl#isPoint <em>Point</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLMacroCallImpl#isRelative <em>Relative</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLMacroCallImpl#getName <em>Name</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLMacroCallImpl#getParams <em>Params</em>}</li>
@ -43,6 +44,26 @@ import org.wesnoth.wML.WMLPackage;
*/
public class WMLMacroCallImpl extends WMLKeyValueImpl implements WMLMacroCall
{
/**
* The default value of the '{@link #isPoint() <em>Point</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isPoint()
* @generated
* @ordered
*/
protected static final boolean POINT_EDEFAULT = false;
/**
* The cached value of the '{@link #isPoint() <em>Point</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isPoint()
* @generated
* @ordered
*/
protected boolean point = POINT_EDEFAULT;
/**
* The default value of the '{@link #isRelative() <em>Relative</em>}' attribute.
* <!-- begin-user-doc -->
@ -124,6 +145,29 @@ public class WMLMacroCallImpl extends WMLKeyValueImpl implements WMLMacroCall
return WMLPackage.Literals.WML_MACRO_CALL;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isPoint()
{
return point;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPoint(boolean newPoint)
{
boolean oldPoint = point;
point = newPoint;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WMLPackage.WML_MACRO_CALL__POINT, oldPoint, point));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@ -226,6 +270,8 @@ public class WMLMacroCallImpl extends WMLKeyValueImpl implements WMLMacroCall
{
switch (featureID)
{
case WMLPackage.WML_MACRO_CALL__POINT:
return isPoint();
case WMLPackage.WML_MACRO_CALL__RELATIVE:
return isRelative();
case WMLPackage.WML_MACRO_CALL__NAME:
@ -249,6 +295,9 @@ public class WMLMacroCallImpl extends WMLKeyValueImpl implements WMLMacroCall
{
switch (featureID)
{
case WMLPackage.WML_MACRO_CALL__POINT:
setPoint((Boolean)newValue);
return;
case WMLPackage.WML_MACRO_CALL__RELATIVE:
setRelative((Boolean)newValue);
return;
@ -277,6 +326,9 @@ public class WMLMacroCallImpl extends WMLKeyValueImpl implements WMLMacroCall
{
switch (featureID)
{
case WMLPackage.WML_MACRO_CALL__POINT:
setPoint(POINT_EDEFAULT);
return;
case WMLPackage.WML_MACRO_CALL__RELATIVE:
setRelative(RELATIVE_EDEFAULT);
return;
@ -303,6 +355,8 @@ public class WMLMacroCallImpl extends WMLKeyValueImpl implements WMLMacroCall
{
switch (featureID)
{
case WMLPackage.WML_MACRO_CALL__POINT:
return point != POINT_EDEFAULT;
case WMLPackage.WML_MACRO_CALL__RELATIVE:
return relative != RELATIVE_EDEFAULT;
case WMLPackage.WML_MACRO_CALL__NAME:
@ -326,7 +380,9 @@ public class WMLMacroCallImpl extends WMLKeyValueImpl implements WMLMacroCall
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (relative: ");
result.append(" (point: ");
result.append(point);
result.append(", relative: ");
result.append(relative);
result.append(", name: ");
result.append(name);

View file

@ -26,6 +26,7 @@ import org.wesnoth.wML.WMLKey;
import org.wesnoth.wML.WMLMacroCall;
import org.wesnoth.wML.WMLMacroDefine;
import org.wesnoth.wML.WMLPackage;
import org.wesnoth.wML.WMLPreprocIF;
import org.wesnoth.wML.WMLTag;
import org.wesnoth.wML.WMLTextdomain;
import org.wesnoth.wML.WMLValue;
@ -44,6 +45,7 @@ import org.wesnoth.wML.WMLValue;
* <li>{@link org.wesnoth.wML.impl.WMLMacroDefineImpl#getMacroDefines <em>Macro Defines</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLMacroDefineImpl#getTextdomains <em>Textdomains</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLMacroDefineImpl#getValues <em>Values</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLMacroDefineImpl#getIfDefs <em>If Defs</em>}</li>
* </ul>
* </p>
*
@ -131,6 +133,16 @@ public class WMLMacroDefineImpl extends MinimalEObjectImpl.Container implements
*/
protected EList<WMLValue> values;
/**
* The cached value of the '{@link #getIfDefs() <em>If Defs</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIfDefs()
* @generated
* @ordered
*/
protected EList<WMLPreprocIF> ifDefs;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@ -259,6 +271,20 @@ public class WMLMacroDefineImpl extends MinimalEObjectImpl.Container implements
return values;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<WMLPreprocIF> getIfDefs()
{
if (ifDefs == null)
{
ifDefs = new EObjectContainmentEList<WMLPreprocIF>(WMLPreprocIF.class, this, WMLPackage.WML_MACRO_DEFINE__IF_DEFS);
}
return ifDefs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@ -281,6 +307,8 @@ public class WMLMacroDefineImpl extends MinimalEObjectImpl.Container implements
return ((InternalEList<?>)getTextdomains()).basicRemove(otherEnd, msgs);
case WMLPackage.WML_MACRO_DEFINE__VALUES:
return ((InternalEList<?>)getValues()).basicRemove(otherEnd, msgs);
case WMLPackage.WML_MACRO_DEFINE__IF_DEFS:
return ((InternalEList<?>)getIfDefs()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
@ -309,6 +337,8 @@ public class WMLMacroDefineImpl extends MinimalEObjectImpl.Container implements
return getTextdomains();
case WMLPackage.WML_MACRO_DEFINE__VALUES:
return getValues();
case WMLPackage.WML_MACRO_DEFINE__IF_DEFS:
return getIfDefs();
}
return super.eGet(featureID, resolve, coreType);
}
@ -351,6 +381,10 @@ public class WMLMacroDefineImpl extends MinimalEObjectImpl.Container implements
getValues().clear();
getValues().addAll((Collection<? extends WMLValue>)newValue);
return;
case WMLPackage.WML_MACRO_DEFINE__IF_DEFS:
getIfDefs().clear();
getIfDefs().addAll((Collection<? extends WMLPreprocIF>)newValue);
return;
}
super.eSet(featureID, newValue);
}
@ -386,6 +420,9 @@ public class WMLMacroDefineImpl extends MinimalEObjectImpl.Container implements
case WMLPackage.WML_MACRO_DEFINE__VALUES:
getValues().clear();
return;
case WMLPackage.WML_MACRO_DEFINE__IF_DEFS:
getIfDefs().clear();
return;
}
super.eUnset(featureID);
}
@ -414,6 +451,8 @@ public class WMLMacroDefineImpl extends MinimalEObjectImpl.Container implements
return textdomains != null && !textdomains.isEmpty();
case WMLPackage.WML_MACRO_DEFINE__VALUES:
return values != null && !values.isEmpty();
case WMLPackage.WML_MACRO_DEFINE__IF_DEFS:
return ifDefs != null && !ifDefs.isEmpty();
}
return super.eIsSet(featureID);
}

View file

@ -22,6 +22,7 @@ import org.wesnoth.wML.WMLLuaCode;
import org.wesnoth.wML.WMLMacroCall;
import org.wesnoth.wML.WMLMacroDefine;
import org.wesnoth.wML.WMLPackage;
import org.wesnoth.wML.WMLPreprocIF;
import org.wesnoth.wML.WMLRoot;
import org.wesnoth.wML.WMLTag;
import org.wesnoth.wML.WMLTextdomain;
@ -91,6 +92,13 @@ public class WMLPackageImpl extends EPackageImpl implements WMLPackage
*/
private EClass wmlMacroDefineEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass wmlPreprocIFEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@ -225,6 +233,16 @@ public class WMLPackageImpl extends EPackageImpl implements WMLPackage
return (EReference)wmlRootEClass.getEStructuralFeatures().get(3);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getWMLRoot_IfDefs()
{
return (EReference)wmlRootEClass.getEStructuralFeatures().get(4);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@ -305,6 +323,16 @@ public class WMLPackageImpl extends EPackageImpl implements WMLPackage
return (EReference)wmlTagEClass.getEStructuralFeatures().get(6);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getWMLTag_IfDefs()
{
return (EReference)wmlTagEClass.getEStructuralFeatures().get(7);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@ -312,7 +340,7 @@ public class WMLPackageImpl extends EPackageImpl implements WMLPackage
*/
public EAttribute getWMLTag_EndName()
{
return (EAttribute)wmlTagEClass.getEStructuralFeatures().get(7);
return (EAttribute)wmlTagEClass.getEStructuralFeatures().get(8);
}
/**
@ -370,7 +398,7 @@ public class WMLPackageImpl extends EPackageImpl implements WMLPackage
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getWMLMacroCall_Relative()
public EAttribute getWMLMacroCall_Point()
{
return (EAttribute)wmlMacroCallEClass.getEStructuralFeatures().get(0);
}
@ -380,11 +408,21 @@ public class WMLPackageImpl extends EPackageImpl implements WMLPackage
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getWMLMacroCall_Name()
public EAttribute getWMLMacroCall_Relative()
{
return (EAttribute)wmlMacroCallEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getWMLMacroCall_Name()
{
return (EAttribute)wmlMacroCallEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@ -392,7 +430,7 @@ public class WMLPackageImpl extends EPackageImpl implements WMLPackage
*/
public EReference getWMLMacroCall_Params()
{
return (EReference)wmlMacroCallEClass.getEStructuralFeatures().get(2);
return (EReference)wmlMacroCallEClass.getEStructuralFeatures().get(3);
}
/**
@ -402,7 +440,7 @@ public class WMLPackageImpl extends EPackageImpl implements WMLPackage
*/
public EReference getWMLMacroCall_ExtraMacros()
{
return (EReference)wmlMacroCallEClass.getEStructuralFeatures().get(3);
return (EReference)wmlMacroCallEClass.getEStructuralFeatures().get(4);
}
/**
@ -525,6 +563,116 @@ public class WMLPackageImpl extends EPackageImpl implements WMLPackage
return (EReference)wmlMacroDefineEClass.getEStructuralFeatures().get(6);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getWMLMacroDefine_IfDefs()
{
return (EReference)wmlMacroDefineEClass.getEStructuralFeatures().get(7);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getWMLPreprocIF()
{
return wmlPreprocIFEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getWMLPreprocIF_Name()
{
return (EAttribute)wmlPreprocIFEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getWMLPreprocIF_Tags()
{
return (EReference)wmlPreprocIFEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getWMLPreprocIF_Keys()
{
return (EReference)wmlPreprocIFEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getWMLPreprocIF_MacroCalls()
{
return (EReference)wmlPreprocIFEClass.getEStructuralFeatures().get(3);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getWMLPreprocIF_MacroDefines()
{
return (EReference)wmlPreprocIFEClass.getEStructuralFeatures().get(4);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getWMLPreprocIF_Textdomains()
{
return (EReference)wmlPreprocIFEClass.getEStructuralFeatures().get(5);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getWMLPreprocIF_Values()
{
return (EReference)wmlPreprocIFEClass.getEStructuralFeatures().get(6);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getWMLPreprocIF_IfDefs()
{
return (EReference)wmlPreprocIFEClass.getEStructuralFeatures().get(7);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getWMLPreprocIF_Elses()
{
return (EAttribute)wmlPreprocIFEClass.getEStructuralFeatures().get(8);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@ -620,6 +768,7 @@ public class WMLPackageImpl extends EPackageImpl implements WMLPackage
createEReference(wmlRootEClass, WML_ROOT__MACRO_CALLS);
createEReference(wmlRootEClass, WML_ROOT__MACRO_DEFINES);
createEReference(wmlRootEClass, WML_ROOT__TEXTDOMAINS);
createEReference(wmlRootEClass, WML_ROOT__IF_DEFS);
wmlTagEClass = createEClass(WML_TAG);
createEAttribute(wmlTagEClass, WML_TAG__PLUS);
@ -629,6 +778,7 @@ public class WMLPackageImpl extends EPackageImpl implements WMLPackage
createEReference(wmlTagEClass, WML_TAG__MACRO_CALLS);
createEReference(wmlTagEClass, WML_TAG__MACRO_DEFINES);
createEReference(wmlTagEClass, WML_TAG__TEXTDOMAINS);
createEReference(wmlTagEClass, WML_TAG__IF_DEFS);
createEAttribute(wmlTagEClass, WML_TAG__END_NAME);
wmlKeyEClass = createEClass(WML_KEY);
@ -638,6 +788,7 @@ public class WMLPackageImpl extends EPackageImpl implements WMLPackage
wmlKeyValueEClass = createEClass(WML_KEY_VALUE);
wmlMacroCallEClass = createEClass(WML_MACRO_CALL);
createEAttribute(wmlMacroCallEClass, WML_MACRO_CALL__POINT);
createEAttribute(wmlMacroCallEClass, WML_MACRO_CALL__RELATIVE);
createEAttribute(wmlMacroCallEClass, WML_MACRO_CALL__NAME);
createEReference(wmlMacroCallEClass, WML_MACRO_CALL__PARAMS);
@ -657,6 +808,18 @@ public class WMLPackageImpl extends EPackageImpl implements WMLPackage
createEReference(wmlMacroDefineEClass, WML_MACRO_DEFINE__MACRO_DEFINES);
createEReference(wmlMacroDefineEClass, WML_MACRO_DEFINE__TEXTDOMAINS);
createEReference(wmlMacroDefineEClass, WML_MACRO_DEFINE__VALUES);
createEReference(wmlMacroDefineEClass, WML_MACRO_DEFINE__IF_DEFS);
wmlPreprocIFEClass = createEClass(WML_PREPROC_IF);
createEAttribute(wmlPreprocIFEClass, WML_PREPROC_IF__NAME);
createEReference(wmlPreprocIFEClass, WML_PREPROC_IF__TAGS);
createEReference(wmlPreprocIFEClass, WML_PREPROC_IF__KEYS);
createEReference(wmlPreprocIFEClass, WML_PREPROC_IF__MACRO_CALLS);
createEReference(wmlPreprocIFEClass, WML_PREPROC_IF__MACRO_DEFINES);
createEReference(wmlPreprocIFEClass, WML_PREPROC_IF__TEXTDOMAINS);
createEReference(wmlPreprocIFEClass, WML_PREPROC_IF__VALUES);
createEReference(wmlPreprocIFEClass, WML_PREPROC_IF__IF_DEFS);
createEAttribute(wmlPreprocIFEClass, WML_PREPROC_IF__ELSES);
wmlTextdomainEClass = createEClass(WML_TEXTDOMAIN);
createEAttribute(wmlTextdomainEClass, WML_TEXTDOMAIN__NAME);
@ -708,6 +871,7 @@ public class WMLPackageImpl extends EPackageImpl implements WMLPackage
initEReference(getWMLRoot_MacroCalls(), this.getWMLMacroCall(), null, "MacroCalls", null, 0, -1, WMLRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getWMLRoot_MacroDefines(), this.getWMLMacroDefine(), null, "MacroDefines", null, 0, -1, WMLRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getWMLRoot_Textdomains(), this.getWMLTextdomain(), null, "Textdomains", null, 0, -1, WMLRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getWMLRoot_IfDefs(), this.getWMLPreprocIF(), null, "IfDefs", null, 0, -1, WMLRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(wmlTagEClass, WMLTag.class, "WMLTag", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getWMLTag_Plus(), ecorePackage.getEBoolean(), "plus", null, 0, 1, WMLTag.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@ -717,6 +881,7 @@ public class WMLPackageImpl extends EPackageImpl implements WMLPackage
initEReference(getWMLTag_MacroCalls(), this.getWMLMacroCall(), null, "MacroCalls", null, 0, -1, WMLTag.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getWMLTag_MacroDefines(), this.getWMLMacroDefine(), null, "MacroDefines", null, 0, -1, WMLTag.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getWMLTag_Textdomains(), this.getWMLTextdomain(), null, "Textdomains", null, 0, -1, WMLTag.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getWMLTag_IfDefs(), this.getWMLPreprocIF(), null, "IfDefs", null, 0, -1, WMLTag.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getWMLTag_EndName(), ecorePackage.getEString(), "endName", null, 0, 1, WMLTag.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(wmlKeyEClass, WMLKey.class, "WMLKey", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@ -726,6 +891,7 @@ public class WMLPackageImpl extends EPackageImpl implements WMLPackage
initEClass(wmlKeyValueEClass, WMLKeyValue.class, "WMLKeyValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(wmlMacroCallEClass, WMLMacroCall.class, "WMLMacroCall", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getWMLMacroCall_Point(), ecorePackage.getEBoolean(), "point", null, 0, 1, WMLMacroCall.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getWMLMacroCall_Relative(), ecorePackage.getEBoolean(), "relative", null, 0, 1, WMLMacroCall.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getWMLMacroCall_Name(), ecorePackage.getEString(), "name", null, 0, 1, WMLMacroCall.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getWMLMacroCall_Params(), ecorePackage.getEObject(), null, "params", null, 0, -1, WMLMacroCall.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@ -745,6 +911,18 @@ public class WMLPackageImpl extends EPackageImpl implements WMLPackage
initEReference(getWMLMacroDefine_MacroDefines(), this.getWMLMacroDefine(), null, "MacroDefines", null, 0, -1, WMLMacroDefine.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getWMLMacroDefine_Textdomains(), this.getWMLTextdomain(), null, "Textdomains", null, 0, -1, WMLMacroDefine.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getWMLMacroDefine_Values(), this.getWMLValue(), null, "Values", null, 0, -1, WMLMacroDefine.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getWMLMacroDefine_IfDefs(), this.getWMLPreprocIF(), null, "IfDefs", null, 0, -1, WMLMacroDefine.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(wmlPreprocIFEClass, WMLPreprocIF.class, "WMLPreprocIF", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getWMLPreprocIF_Name(), ecorePackage.getEString(), "name", null, 0, 1, WMLPreprocIF.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getWMLPreprocIF_Tags(), this.getWMLTag(), null, "Tags", null, 0, -1, WMLPreprocIF.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getWMLPreprocIF_Keys(), this.getWMLKey(), null, "Keys", null, 0, -1, WMLPreprocIF.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getWMLPreprocIF_MacroCalls(), this.getWMLMacroCall(), null, "MacroCalls", null, 0, -1, WMLPreprocIF.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getWMLPreprocIF_MacroDefines(), this.getWMLMacroDefine(), null, "MacroDefines", null, 0, -1, WMLPreprocIF.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getWMLPreprocIF_Textdomains(), this.getWMLTextdomain(), null, "Textdomains", null, 0, -1, WMLPreprocIF.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getWMLPreprocIF_Values(), this.getWMLValue(), null, "Values", null, 0, -1, WMLPreprocIF.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getWMLPreprocIF_IfDefs(), this.getWMLPreprocIF(), null, "IfDefs", null, 0, -1, WMLPreprocIF.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getWMLPreprocIF_Elses(), ecorePackage.getEString(), "Elses", null, 0, -1, WMLPreprocIF.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(wmlTextdomainEClass, WMLTextdomain.class, "WMLTextdomain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getWMLTextdomain_Name(), ecorePackage.getEString(), "name", null, 0, 1, WMLTextdomain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

View file

@ -0,0 +1,516 @@
/**
* <copyright>
* </copyright>
*
*/
package org.wesnoth.wML.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EDataTypeEList;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.wesnoth.wML.WMLKey;
import org.wesnoth.wML.WMLMacroCall;
import org.wesnoth.wML.WMLMacroDefine;
import org.wesnoth.wML.WMLPackage;
import org.wesnoth.wML.WMLPreprocIF;
import org.wesnoth.wML.WMLTag;
import org.wesnoth.wML.WMLTextdomain;
import org.wesnoth.wML.WMLValue;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Preproc IF</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.wesnoth.wML.impl.WMLPreprocIFImpl#getName <em>Name</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLPreprocIFImpl#getTags <em>Tags</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLPreprocIFImpl#getKeys <em>Keys</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLPreprocIFImpl#getMacroCalls <em>Macro Calls</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLPreprocIFImpl#getMacroDefines <em>Macro Defines</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLPreprocIFImpl#getTextdomains <em>Textdomains</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLPreprocIFImpl#getValues <em>Values</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLPreprocIFImpl#getIfDefs <em>If Defs</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLPreprocIFImpl#getElses <em>Elses</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class WMLPreprocIFImpl extends MinimalEObjectImpl.Container implements WMLPreprocIF
{
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The cached value of the '{@link #getTags() <em>Tags</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTags()
* @generated
* @ordered
*/
protected EList<WMLTag> tags;
/**
* The cached value of the '{@link #getKeys() <em>Keys</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getKeys()
* @generated
* @ordered
*/
protected EList<WMLKey> keys;
/**
* The cached value of the '{@link #getMacroCalls() <em>Macro Calls</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMacroCalls()
* @generated
* @ordered
*/
protected EList<WMLMacroCall> macroCalls;
/**
* The cached value of the '{@link #getMacroDefines() <em>Macro Defines</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMacroDefines()
* @generated
* @ordered
*/
protected EList<WMLMacroDefine> macroDefines;
/**
* The cached value of the '{@link #getTextdomains() <em>Textdomains</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTextdomains()
* @generated
* @ordered
*/
protected EList<WMLTextdomain> textdomains;
/**
* The cached value of the '{@link #getValues() <em>Values</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValues()
* @generated
* @ordered
*/
protected EList<WMLValue> values;
/**
* The cached value of the '{@link #getIfDefs() <em>If Defs</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIfDefs()
* @generated
* @ordered
*/
protected EList<WMLPreprocIF> ifDefs;
/**
* The cached value of the '{@link #getElses() <em>Elses</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getElses()
* @generated
* @ordered
*/
protected EList<String> elses;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected WMLPreprocIFImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return WMLPackage.Literals.WML_PREPROC_IF;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName()
{
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(String newName)
{
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WMLPackage.WML_PREPROC_IF__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<WMLTag> getTags()
{
if (tags == null)
{
tags = new EObjectContainmentEList<WMLTag>(WMLTag.class, this, WMLPackage.WML_PREPROC_IF__TAGS);
}
return tags;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<WMLKey> getKeys()
{
if (keys == null)
{
keys = new EObjectContainmentEList<WMLKey>(WMLKey.class, this, WMLPackage.WML_PREPROC_IF__KEYS);
}
return keys;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<WMLMacroCall> getMacroCalls()
{
if (macroCalls == null)
{
macroCalls = new EObjectContainmentEList<WMLMacroCall>(WMLMacroCall.class, this, WMLPackage.WML_PREPROC_IF__MACRO_CALLS);
}
return macroCalls;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<WMLMacroDefine> getMacroDefines()
{
if (macroDefines == null)
{
macroDefines = new EObjectContainmentEList<WMLMacroDefine>(WMLMacroDefine.class, this, WMLPackage.WML_PREPROC_IF__MACRO_DEFINES);
}
return macroDefines;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<WMLTextdomain> getTextdomains()
{
if (textdomains == null)
{
textdomains = new EObjectContainmentEList<WMLTextdomain>(WMLTextdomain.class, this, WMLPackage.WML_PREPROC_IF__TEXTDOMAINS);
}
return textdomains;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<WMLValue> getValues()
{
if (values == null)
{
values = new EObjectContainmentEList<WMLValue>(WMLValue.class, this, WMLPackage.WML_PREPROC_IF__VALUES);
}
return values;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<WMLPreprocIF> getIfDefs()
{
if (ifDefs == null)
{
ifDefs = new EObjectContainmentEList<WMLPreprocIF>(WMLPreprocIF.class, this, WMLPackage.WML_PREPROC_IF__IF_DEFS);
}
return ifDefs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<String> getElses()
{
if (elses == null)
{
elses = new EDataTypeEList<String>(String.class, this, WMLPackage.WML_PREPROC_IF__ELSES);
}
return elses;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case WMLPackage.WML_PREPROC_IF__TAGS:
return ((InternalEList<?>)getTags()).basicRemove(otherEnd, msgs);
case WMLPackage.WML_PREPROC_IF__KEYS:
return ((InternalEList<?>)getKeys()).basicRemove(otherEnd, msgs);
case WMLPackage.WML_PREPROC_IF__MACRO_CALLS:
return ((InternalEList<?>)getMacroCalls()).basicRemove(otherEnd, msgs);
case WMLPackage.WML_PREPROC_IF__MACRO_DEFINES:
return ((InternalEList<?>)getMacroDefines()).basicRemove(otherEnd, msgs);
case WMLPackage.WML_PREPROC_IF__TEXTDOMAINS:
return ((InternalEList<?>)getTextdomains()).basicRemove(otherEnd, msgs);
case WMLPackage.WML_PREPROC_IF__VALUES:
return ((InternalEList<?>)getValues()).basicRemove(otherEnd, msgs);
case WMLPackage.WML_PREPROC_IF__IF_DEFS:
return ((InternalEList<?>)getIfDefs()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case WMLPackage.WML_PREPROC_IF__NAME:
return getName();
case WMLPackage.WML_PREPROC_IF__TAGS:
return getTags();
case WMLPackage.WML_PREPROC_IF__KEYS:
return getKeys();
case WMLPackage.WML_PREPROC_IF__MACRO_CALLS:
return getMacroCalls();
case WMLPackage.WML_PREPROC_IF__MACRO_DEFINES:
return getMacroDefines();
case WMLPackage.WML_PREPROC_IF__TEXTDOMAINS:
return getTextdomains();
case WMLPackage.WML_PREPROC_IF__VALUES:
return getValues();
case WMLPackage.WML_PREPROC_IF__IF_DEFS:
return getIfDefs();
case WMLPackage.WML_PREPROC_IF__ELSES:
return getElses();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case WMLPackage.WML_PREPROC_IF__NAME:
setName((String)newValue);
return;
case WMLPackage.WML_PREPROC_IF__TAGS:
getTags().clear();
getTags().addAll((Collection<? extends WMLTag>)newValue);
return;
case WMLPackage.WML_PREPROC_IF__KEYS:
getKeys().clear();
getKeys().addAll((Collection<? extends WMLKey>)newValue);
return;
case WMLPackage.WML_PREPROC_IF__MACRO_CALLS:
getMacroCalls().clear();
getMacroCalls().addAll((Collection<? extends WMLMacroCall>)newValue);
return;
case WMLPackage.WML_PREPROC_IF__MACRO_DEFINES:
getMacroDefines().clear();
getMacroDefines().addAll((Collection<? extends WMLMacroDefine>)newValue);
return;
case WMLPackage.WML_PREPROC_IF__TEXTDOMAINS:
getTextdomains().clear();
getTextdomains().addAll((Collection<? extends WMLTextdomain>)newValue);
return;
case WMLPackage.WML_PREPROC_IF__VALUES:
getValues().clear();
getValues().addAll((Collection<? extends WMLValue>)newValue);
return;
case WMLPackage.WML_PREPROC_IF__IF_DEFS:
getIfDefs().clear();
getIfDefs().addAll((Collection<? extends WMLPreprocIF>)newValue);
return;
case WMLPackage.WML_PREPROC_IF__ELSES:
getElses().clear();
getElses().addAll((Collection<? extends String>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case WMLPackage.WML_PREPROC_IF__NAME:
setName(NAME_EDEFAULT);
return;
case WMLPackage.WML_PREPROC_IF__TAGS:
getTags().clear();
return;
case WMLPackage.WML_PREPROC_IF__KEYS:
getKeys().clear();
return;
case WMLPackage.WML_PREPROC_IF__MACRO_CALLS:
getMacroCalls().clear();
return;
case WMLPackage.WML_PREPROC_IF__MACRO_DEFINES:
getMacroDefines().clear();
return;
case WMLPackage.WML_PREPROC_IF__TEXTDOMAINS:
getTextdomains().clear();
return;
case WMLPackage.WML_PREPROC_IF__VALUES:
getValues().clear();
return;
case WMLPackage.WML_PREPROC_IF__IF_DEFS:
getIfDefs().clear();
return;
case WMLPackage.WML_PREPROC_IF__ELSES:
getElses().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case WMLPackage.WML_PREPROC_IF__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case WMLPackage.WML_PREPROC_IF__TAGS:
return tags != null && !tags.isEmpty();
case WMLPackage.WML_PREPROC_IF__KEYS:
return keys != null && !keys.isEmpty();
case WMLPackage.WML_PREPROC_IF__MACRO_CALLS:
return macroCalls != null && !macroCalls.isEmpty();
case WMLPackage.WML_PREPROC_IF__MACRO_DEFINES:
return macroDefines != null && !macroDefines.isEmpty();
case WMLPackage.WML_PREPROC_IF__TEXTDOMAINS:
return textdomains != null && !textdomains.isEmpty();
case WMLPackage.WML_PREPROC_IF__VALUES:
return values != null && !values.isEmpty();
case WMLPackage.WML_PREPROC_IF__IF_DEFS:
return ifDefs != null && !ifDefs.isEmpty();
case WMLPackage.WML_PREPROC_IF__ELSES:
return elses != null && !elses.isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
result.append(name);
result.append(", Elses: ");
result.append(elses);
result.append(')');
return result.toString();
}
} //WMLPreprocIFImpl

View file

@ -23,6 +23,7 @@ import org.eclipse.emf.ecore.util.InternalEList;
import org.wesnoth.wML.WMLMacroCall;
import org.wesnoth.wML.WMLMacroDefine;
import org.wesnoth.wML.WMLPackage;
import org.wesnoth.wML.WMLPreprocIF;
import org.wesnoth.wML.WMLRoot;
import org.wesnoth.wML.WMLTag;
import org.wesnoth.wML.WMLTextdomain;
@ -38,6 +39,7 @@ import org.wesnoth.wML.WMLTextdomain;
* <li>{@link org.wesnoth.wML.impl.WMLRootImpl#getMacroCalls <em>Macro Calls</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLRootImpl#getMacroDefines <em>Macro Defines</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLRootImpl#getTextdomains <em>Textdomains</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLRootImpl#getIfDefs <em>If Defs</em>}</li>
* </ul>
* </p>
*
@ -85,6 +87,16 @@ public class WMLRootImpl extends MinimalEObjectImpl.Container implements WMLRoot
*/
protected EList<WMLTextdomain> textdomains;
/**
* The cached value of the '{@link #getIfDefs() <em>If Defs</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIfDefs()
* @generated
* @ordered
*/
protected EList<WMLPreprocIF> ifDefs;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@ -162,6 +174,20 @@ public class WMLRootImpl extends MinimalEObjectImpl.Container implements WMLRoot
return textdomains;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<WMLPreprocIF> getIfDefs()
{
if (ifDefs == null)
{
ifDefs = new EObjectContainmentEList<WMLPreprocIF>(WMLPreprocIF.class, this, WMLPackage.WML_ROOT__IF_DEFS);
}
return ifDefs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@ -180,6 +206,8 @@ public class WMLRootImpl extends MinimalEObjectImpl.Container implements WMLRoot
return ((InternalEList<?>)getMacroDefines()).basicRemove(otherEnd, msgs);
case WMLPackage.WML_ROOT__TEXTDOMAINS:
return ((InternalEList<?>)getTextdomains()).basicRemove(otherEnd, msgs);
case WMLPackage.WML_ROOT__IF_DEFS:
return ((InternalEList<?>)getIfDefs()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
@ -202,6 +230,8 @@ public class WMLRootImpl extends MinimalEObjectImpl.Container implements WMLRoot
return getMacroDefines();
case WMLPackage.WML_ROOT__TEXTDOMAINS:
return getTextdomains();
case WMLPackage.WML_ROOT__IF_DEFS:
return getIfDefs();
}
return super.eGet(featureID, resolve, coreType);
}
@ -233,6 +263,10 @@ public class WMLRootImpl extends MinimalEObjectImpl.Container implements WMLRoot
getTextdomains().clear();
getTextdomains().addAll((Collection<? extends WMLTextdomain>)newValue);
return;
case WMLPackage.WML_ROOT__IF_DEFS:
getIfDefs().clear();
getIfDefs().addAll((Collection<? extends WMLPreprocIF>)newValue);
return;
}
super.eSet(featureID, newValue);
}
@ -259,6 +293,9 @@ public class WMLRootImpl extends MinimalEObjectImpl.Container implements WMLRoot
case WMLPackage.WML_ROOT__TEXTDOMAINS:
getTextdomains().clear();
return;
case WMLPackage.WML_ROOT__IF_DEFS:
getIfDefs().clear();
return;
}
super.eUnset(featureID);
}
@ -281,6 +318,8 @@ public class WMLRootImpl extends MinimalEObjectImpl.Container implements WMLRoot
return macroDefines != null && !macroDefines.isEmpty();
case WMLPackage.WML_ROOT__TEXTDOMAINS:
return textdomains != null && !textdomains.isEmpty();
case WMLPackage.WML_ROOT__IF_DEFS:
return ifDefs != null && !ifDefs.isEmpty();
}
return super.eIsSet(featureID);
}

View file

@ -26,6 +26,7 @@ import org.wesnoth.wML.WMLKey;
import org.wesnoth.wML.WMLMacroCall;
import org.wesnoth.wML.WMLMacroDefine;
import org.wesnoth.wML.WMLPackage;
import org.wesnoth.wML.WMLPreprocIF;
import org.wesnoth.wML.WMLTag;
import org.wesnoth.wML.WMLTextdomain;
@ -43,6 +44,7 @@ import org.wesnoth.wML.WMLTextdomain;
* <li>{@link org.wesnoth.wML.impl.WMLTagImpl#getMacroCalls <em>Macro Calls</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLTagImpl#getMacroDefines <em>Macro Defines</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLTagImpl#getTextdomains <em>Textdomains</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLTagImpl#getIfDefs <em>If Defs</em>}</li>
* <li>{@link org.wesnoth.wML.impl.WMLTagImpl#getEndName <em>End Name</em>}</li>
* </ul>
* </p>
@ -141,6 +143,16 @@ public class WMLTagImpl extends MinimalEObjectImpl.Container implements WMLTag
*/
protected EList<WMLTextdomain> textdomains;
/**
* The cached value of the '{@link #getIfDefs() <em>If Defs</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIfDefs()
* @generated
* @ordered
*/
protected EList<WMLPreprocIF> ifDefs;
/**
* The default value of the '{@link #getEndName() <em>End Name</em>}' attribute.
* <!-- begin-user-doc -->
@ -298,6 +310,20 @@ public class WMLTagImpl extends MinimalEObjectImpl.Container implements WMLTag
return textdomains;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<WMLPreprocIF> getIfDefs()
{
if (ifDefs == null)
{
ifDefs = new EObjectContainmentEList<WMLPreprocIF>(WMLPreprocIF.class, this, WMLPackage.WML_TAG__IF_DEFS);
}
return ifDefs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@ -341,6 +367,8 @@ public class WMLTagImpl extends MinimalEObjectImpl.Container implements WMLTag
return ((InternalEList<?>)getMacroDefines()).basicRemove(otherEnd, msgs);
case WMLPackage.WML_TAG__TEXTDOMAINS:
return ((InternalEList<?>)getTextdomains()).basicRemove(otherEnd, msgs);
case WMLPackage.WML_TAG__IF_DEFS:
return ((InternalEList<?>)getIfDefs()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
@ -369,6 +397,8 @@ public class WMLTagImpl extends MinimalEObjectImpl.Container implements WMLTag
return getMacroDefines();
case WMLPackage.WML_TAG__TEXTDOMAINS:
return getTextdomains();
case WMLPackage.WML_TAG__IF_DEFS:
return getIfDefs();
case WMLPackage.WML_TAG__END_NAME:
return getEndName();
}
@ -412,6 +442,10 @@ public class WMLTagImpl extends MinimalEObjectImpl.Container implements WMLTag
getTextdomains().clear();
getTextdomains().addAll((Collection<? extends WMLTextdomain>)newValue);
return;
case WMLPackage.WML_TAG__IF_DEFS:
getIfDefs().clear();
getIfDefs().addAll((Collection<? extends WMLPreprocIF>)newValue);
return;
case WMLPackage.WML_TAG__END_NAME:
setEndName((String)newValue);
return;
@ -450,6 +484,9 @@ public class WMLTagImpl extends MinimalEObjectImpl.Container implements WMLTag
case WMLPackage.WML_TAG__TEXTDOMAINS:
getTextdomains().clear();
return;
case WMLPackage.WML_TAG__IF_DEFS:
getIfDefs().clear();
return;
case WMLPackage.WML_TAG__END_NAME:
setEndName(END_NAME_EDEFAULT);
return;
@ -481,6 +518,8 @@ public class WMLTagImpl extends MinimalEObjectImpl.Container implements WMLTag
return macroDefines != null && !macroDefines.isEmpty();
case WMLPackage.WML_TAG__TEXTDOMAINS:
return textdomains != null && !textdomains.isEmpty();
case WMLPackage.WML_TAG__IF_DEFS:
return ifDefs != null && !ifDefs.isEmpty();
case WMLPackage.WML_TAG__END_NAME:
return END_NAME_EDEFAULT == null ? endName != null : !END_NAME_EDEFAULT.equals(endName);
}

View file

@ -119,6 +119,11 @@ public class WMLAdapterFactory extends AdapterFactoryImpl
return createWMLMacroDefineAdapter();
}
@Override
public Adapter caseWMLPreprocIF(WMLPreprocIF object)
{
return createWMLPreprocIFAdapter();
}
@Override
public Adapter caseWMLTextdomain(WMLTextdomain object)
{
return createWMLTextdomainAdapter();
@ -275,6 +280,21 @@ public class WMLAdapterFactory extends AdapterFactoryImpl
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.wesnoth.wML.WMLPreprocIF <em>Preproc IF</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.wesnoth.wML.WMLPreprocIF
* @generated
*/
public Adapter createWMLPreprocIFAdapter()
{
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.wesnoth.wML.WMLTextdomain <em>Textdomain</em>}'.
* <!-- begin-user-doc -->

View file

@ -155,6 +155,13 @@ public class WMLSwitch<T>
if (result == null) result = defaultCase(theEObject);
return result;
}
case WMLPackage.WML_PREPROC_IF:
{
WMLPreprocIF wmlPreprocIF = (WMLPreprocIF)theEObject;
T result = caseWMLPreprocIF(wmlPreprocIF);
if (result == null) result = defaultCase(theEObject);
return result;
}
case WMLPackage.WML_TEXTDOMAIN:
{
WMLTextdomain wmlTextdomain = (WMLTextdomain)theEObject;
@ -309,6 +316,22 @@ public class WMLSwitch<T>
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Preproc IF</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Preproc IF</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseWMLPreprocIF(WMLPreprocIF object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Textdomain</em>'.
* <!-- begin-user-doc -->

View file

@ -15,6 +15,7 @@ WMLRoot:
| MacroCalls += WMLMacroCall
| MacroDefines += WMLMacroDefine
| Textdomains += WMLTextdomain
| IfDefs += WMLPreprocIF
)*
;
@ -25,18 +26,19 @@ WMLTag:
| MacroCalls += WMLMacroCall
| MacroDefines += WMLMacroDefine
| Textdomains += WMLTextdomain
| IfDefs += WMLPreprocIF
)*
'[/' endName = ID ']'
;
WMLKey hidden(WS):
name = ID '=' value += WMLKeyValue* (EOL? '+' EOL? value+=WMLKeyValue )* (EOL|SL_COMMENT);
name = ID '=' value += WMLKeyValue* (EOL? '+' EOL? value+=WMLKeyValue+)* (EOL|SL_COMMENT);
WMLKeyValue:
WMLValue | WMLMacroCall | WMLLuaCode | WMLArrayCall;
WMLMacroCall:
'{' ('.')? (relative?='~')? name=ID
'{' (point?='.' '/')? (relative?='~')? name=ID
( params += (WMLValue | MacroTokens)
| extraMacros += WMLMacroCall
)*
@ -54,14 +56,28 @@ WMLMacroDefine:
| MacroDefines += WMLMacroDefine
| Textdomains += WMLTextdomain
| Values += WMLValue
| IfDefs += WMLPreprocIF
)*
ENDDEF;
WMLPreprocIF:
name=(IFDEF | IFNDEF | IFHAVE | IFNHAVE)
( Tags += WMLTag
| Keys += WMLKey
| MacroCalls += WMLMacroCall
| MacroDefines += WMLMacroDefine
| Textdomains += WMLTextdomain
| Values += WMLValue
| IfDefs += WMLPreprocIF
| Elses += ELSE
)*
ENDIF;
WMLTextdomain:
name = TEXTDOMAIN;
WMLValue:
value = (ID | TSTRING | TVAR | STRING |'~' | '.'|'(' | ')'| ANY_OTHER);
value = (ID | TSTRING | TVAR | STRING |'~' | '.' |'$'|'/' |'(' | ')'| ANY_OTHER);
TSTRING:
'_' STRING;
@ -73,9 +89,17 @@ MacroTokens:
val=('='|'['|']'|'+'|'[/');
terminal LUA_CODE : '<<' -> '>>';
// Preprocessor terminals
terminal IFHAVE : '#ifhave' !('\n'|'\r')* ('\r'? '\n')?;
terminal IFNHAVE : '#ifnhave' !('\n'|'\r')* ('\r'? '\n')?;
terminal IFDEF : '#ifdef' !('\n'|'\r')* ('\r'? '\n')?;
terminal IFNDEF : '#ifndef' !('\n'|'\r')* ('\r'? '\n')?;
terminal ELSE : '#else' !('\n'|'\r')* ('\r'? '\n')?;
terminal ENDIF : '#endif' !('\n'|'\r')* ('\r'? '\n')?;
terminal DEFINE : '#define' !('\n'|'\r')* ('\r'? '\n')?;
terminal ENDDEF : '#enddef' !('\n'|'\r')* ('\r'? '\n')?;
terminal TEXTDOMAIN : '#textdomain' !('\n'|'\r')* ('\r'? '\n')?;
// end preprocessor terminals
terminal STRING : '"' ( '\\' ('b'|'t'|'n'|'f'|'r'|'"'|"'"|'\\') | !('\\'|'"') )* '"';
terminal ID : ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|'-'|',')+;
terminal EOL : ('\r'|'\n');

View file

@ -108,6 +108,7 @@ public abstract class WMLTests extends AbstractXtextTests
* */
protected void checkParsing(String input, String entryRule) {
IParseResult la = getParseResult(input, entryRule);
System.out.println(la.getParseErrors());
assertEquals(input, 0, la.getParseErrors().size());
}

View file

@ -32,9 +32,11 @@ public class WMLTestsImpl extends WMLTests
}
public void testTokenSequences(){
showTokenisation("amount=+$random\n");
checkParsing("amount=+$random", "WMLKey");
checkTokenisation("123 abc", ID, WS, ID);
checkTokenisation("123 \t#comment\n abc", ID, WS, SL_COMMENT,WS,ID);
//note that no white space is necessary!
checkTokenisation("123abc", ID);
}