blob: cfae9a66247deaffba080db3a1d4920f91a6bd49 [file] [log] [blame]
<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI 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">
<xtext:Grammar name="org.eclipse.xtext.example.arithmetics.Arithmetics" usedGrammars="/1">
<metamodelDeclarations xsi:type="xtext:ReferencedMetamodel" alias="ecore">
<ePackage href="http://www.eclipse.org/emf/2002/Ecore#/"/>
</metamodelDeclarations>
<metamodelDeclarations xsi:type="xtext:GeneratedMetamodel" name="arithmetics">
<ePackage href="http://www.eclipse.org/Xtext/example/Arithmetics#/"/>
</metamodelDeclarations>
<rules xsi:type="xtext:ParserRule" name="Module">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//Module"/>
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:Keyword" value="module"/>
<elements xsi:type="xtext:Assignment" feature="name" operator="=">
<terminal xsi:type="xtext:RuleCall" rule="/1/@rules.0"/>
</elements>
<elements xsi:type="xtext:Assignment" cardinality="*" feature="imports" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="/0/@rules.1"/>
</elements>
<elements xsi:type="xtext:Assignment" cardinality="*" feature="statements" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="/0/@rules.3"/>
</elements>
</alternatives>
</rules>
<rules xsi:type="xtext:ParserRule" name="Import">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//Import"/>
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:Keyword" value="import"/>
<elements xsi:type="xtext:Assignment" feature="importedNamespace" operator="=">
<terminal xsi:type="xtext:RuleCall" rule="/0/@rules.2"/>
</elements>
</alternatives>
</rules>
<rules xsi:type="xtext:ParserRule" name="ImportName">
<type metamodel="/0/@metamodelDeclarations.0">
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:RuleCall" rule="/1/@rules.0"/>
<elements xsi:type="xtext:Group" cardinality="?">
<elements xsi:type="xtext:Keyword" value="."/>
<elements xsi:type="xtext:Keyword" value="*"/>
</elements>
</alternatives>
</rules>
<rules xsi:type="xtext:ParserRule" name="Statement">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//Statement"/>
</type>
<alternatives xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:RuleCall" rule="/0/@rules.4"/>
<elements xsi:type="xtext:RuleCall" rule="/0/@rules.7"/>
</alternatives>
</rules>
<rules xsi:type="xtext:ParserRule" name="Definition">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//Definition"/>
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:Keyword" value="def"/>
<elements xsi:type="xtext:Assignment" feature="name" operator="=">
<terminal xsi:type="xtext:RuleCall" rule="/1/@rules.0"/>
</elements>
<elements xsi:type="xtext:Group" cardinality="?">
<elements xsi:type="xtext:Keyword" value="("/>
<elements xsi:type="xtext:Assignment" feature="args" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="/0/@rules.5"/>
</elements>
<elements xsi:type="xtext:Group" cardinality="*">
<elements xsi:type="xtext:Keyword" value=","/>
<elements xsi:type="xtext:Assignment" feature="args" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="/0/@rules.5"/>
</elements>
</elements>
<elements xsi:type="xtext:Keyword" value=")"/>
</elements>
<elements xsi:type="xtext:Keyword" value=":"/>
<elements xsi:type="xtext:Assignment" feature="expr" operator="=">
<terminal xsi:type="xtext:RuleCall" rule="/0/@rules.8"/>
</elements>
<elements xsi:type="xtext:Keyword" value=";"/>
</alternatives>
</rules>
<rules xsi:type="xtext:ParserRule" name="DeclaredParameter">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//DeclaredParameter"/>
</type>
<alternatives xsi:type="xtext:Assignment" feature="name" operator="=">
<terminal xsi:type="xtext:RuleCall" rule="/1/@rules.0"/>
</alternatives>
</rules>
<rules xsi:type="xtext:ParserRule" name="AbstractDefinition">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//AbstractDefinition"/>
</type>
<alternatives xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:RuleCall" rule="/0/@rules.4"/>
<elements xsi:type="xtext:RuleCall" rule="/0/@rules.5"/>
</alternatives>
</rules>
<rules xsi:type="xtext:ParserRule" name="Evaluation">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//Evaluation"/>
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:Assignment" feature="expression" operator="=">
<terminal xsi:type="xtext:RuleCall" rule="/0/@rules.8"/>
</elements>
<elements xsi:type="xtext:Keyword" value=";"/>
</alternatives>
</rules>
<rules xsi:type="xtext:ParserRule" name="Expression">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//Expression"/>
</type>
<alternatives xsi:type="xtext:RuleCall" rule="/0/@rules.9"/>
</rules>
<rules xsi:type="xtext:ParserRule" name="Addition">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//Expression"/>
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:RuleCall" rule="/0/@rules.10"/>
<elements xsi:type="xtext:Group" cardinality="*">
<elements xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:Group">
<elements xsi:type="xtext:Action" feature="left" operator="=">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//Plus"/>
</type>
</elements>
<elements xsi:type="xtext:Keyword" value="+"/>
</elements>
<elements xsi:type="xtext:Group">
<elements xsi:type="xtext:Action" feature="left" operator="=">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//Minus"/>
</type>
</elements>
<elements xsi:type="xtext:Keyword" value="-"/>
</elements>
</elements>
<elements xsi:type="xtext:Assignment" feature="right" operator="=">
<terminal xsi:type="xtext:RuleCall" rule="/0/@rules.10"/>
</elements>
</elements>
</alternatives>
</rules>
<rules xsi:type="xtext:ParserRule" name="Multiplication">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//Expression"/>
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:RuleCall" rule="/0/@rules.11"/>
<elements xsi:type="xtext:Group" cardinality="*">
<elements xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:Group">
<elements xsi:type="xtext:Action" feature="left" operator="=">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//Multi"/>
</type>
</elements>
<elements xsi:type="xtext:Keyword" value="*"/>
</elements>
<elements xsi:type="xtext:Group">
<elements xsi:type="xtext:Action" feature="left" operator="=">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//Div"/>
</type>
</elements>
<elements xsi:type="xtext:Keyword" value="/"/>
</elements>
</elements>
<elements xsi:type="xtext:Assignment" feature="right" operator="=">
<terminal xsi:type="xtext:RuleCall" rule="/0/@rules.11"/>
</elements>
</elements>
</alternatives>
</rules>
<rules xsi:type="xtext:ParserRule" name="PrimaryExpression">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//Expression"/>
</type>
<alternatives xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:Group">
<elements xsi:type="xtext:Keyword" value="("/>
<elements xsi:type="xtext:RuleCall" rule="/0/@rules.8"/>
<elements xsi:type="xtext:Keyword" value=")"/>
</elements>
<elements xsi:type="xtext:Group">
<elements xsi:type="xtext:Action">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//NumberLiteral"/>
</type>
</elements>
<elements xsi:type="xtext:Assignment" feature="value" operator="=">
<terminal xsi:type="xtext:RuleCall" rule="/0/@rules.12"/>
</elements>
</elements>
<elements xsi:type="xtext:Group">
<elements xsi:type="xtext:Action">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//FunctionCall"/>
</type>
</elements>
<elements xsi:type="xtext:Assignment" feature="func" operator="=">
<terminal xsi:type="xtext:CrossReference">
<type metamodel="/0/@metamodelDeclarations.1">
<classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/Xtext/example/Arithmetics#//AbstractDefinition"/>
</type>
<terminal xsi:type="xtext:RuleCall" rule="/1/@rules.0"/>
</terminal>
</elements>
<elements xsi:type="xtext:Group" cardinality="?">
<elements xsi:type="xtext:Keyword" value="("/>
<elements xsi:type="xtext:Assignment" feature="args" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="/0/@rules.8"/>
</elements>
<elements xsi:type="xtext:Group" cardinality="*">
<elements xsi:type="xtext:Keyword" value=","/>
<elements xsi:type="xtext:Assignment" feature="args" operator="+=">
<terminal xsi:type="xtext:RuleCall" rule="/0/@rules.8"/>
</elements>
</elements>
<elements xsi:type="xtext:Keyword" value=")"/>
</elements>
</elements>
</alternatives>
</rules>
<rules xsi:type="xtext:TerminalRule" name="NUMBER">
<type metamodel="/0/@metamodelDeclarations.0">
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBigDecimal"/>
</type>
<alternatives xsi:type="xtext:Group">
<elements xsi:type="xtext:CharacterRange" cardinality="*">
<left value="0"/>
<right value="9"/>
</elements>
<elements xsi:type="xtext:Group" cardinality="?">
<elements xsi:type="xtext:Keyword" value="."/>
<elements xsi:type="xtext:CharacterRange" cardinality="+">
<left value="0"/>
<right value="9"/>
</elements>
</elements>
</alternatives>
</rules>
<rules xsi:type="xtext:TerminalRule" name="INT">
<type metamodel="/0/@metamodelDeclarations.0">
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
</type>
<alternatives xsi:type="xtext:Keyword" value="this one has been deactivated"/>
</rules>
</xtext:Grammar>
<xtext:Grammar name="org.eclipse.xtext.common.Terminals" definesHiddenTokens="true" hiddenTokens="/1/@rules.5 /1/@rules.3 /1/@rules.4">
<metamodelDeclarations xsi:type="xtext:ReferencedMetamodel" alias="ecore">
<ePackage href="http://www.eclipse.org/emf/2002/Ecore#/"/>
</metamodelDeclarations>
<rules xsi:type="xtext:TerminalRule" name="ID">
<type metamodel="/1/@metamodelDeclarations.0">
<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" cardinality="?" value="^"/>
<elements xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:CharacterRange">
<left value="a"/>
<right value="z"/>
</elements>
<elements xsi:type="xtext:CharacterRange">
<left value="A"/>
<right value="Z"/>
</elements>
<elements xsi:type="xtext:Keyword" value="_"/>
</elements>
<elements xsi:type="xtext:Alternatives" cardinality="*">
<elements xsi:type="xtext:CharacterRange">
<left value="a"/>
<right value="z"/>
</elements>
<elements xsi:type="xtext:CharacterRange">
<left value="A"/>
<right value="Z"/>
</elements>
<elements xsi:type="xtext:Keyword" value="_"/>
<elements xsi:type="xtext:CharacterRange">
<left value="0"/>
<right value="9"/>
</elements>
</elements>
</alternatives>
</rules>
<rules xsi:type="xtext:TerminalRule" name="INT">
<type metamodel="/1/@metamodelDeclarations.0">
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
</type>
<alternatives xsi:type="xtext:CharacterRange" cardinality="+">
<left value="0"/>
<right value="9"/>
</alternatives>
</rules>
<rules xsi:type="xtext:TerminalRule" name="STRING">
<type metamodel="/1/@metamodelDeclarations.0">
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</type>
<alternatives xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:Group">
<elements xsi:type="xtext:Keyword" value="&quot;"/>
<elements xsi:type="xtext:Alternatives" cardinality="*">
<elements xsi:type="xtext:Group">
<elements xsi:type="xtext:Keyword" value="\"/>
<elements xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:Keyword" value="b"/>
<elements xsi:type="xtext:Keyword" value="t"/>
<elements xsi:type="xtext:Keyword" value="n"/>
<elements xsi:type="xtext:Keyword" value="f"/>
<elements xsi:type="xtext:Keyword" value="r"/>
<elements xsi:type="xtext:Keyword" value="u"/>
<elements xsi:type="xtext:Keyword" value="&quot;"/>
<elements xsi:type="xtext:Keyword" value="'"/>
<elements xsi:type="xtext:Keyword" value="\"/>
</elements>
</elements>
<elements xsi:type="xtext:NegatedToken">
<terminal xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:Keyword" value="\"/>
<elements xsi:type="xtext:Keyword" value="&quot;"/>
</terminal>
</elements>
</elements>
<elements xsi:type="xtext:Keyword" value="&quot;"/>
</elements>
<elements xsi:type="xtext:Group">
<elements xsi:type="xtext:Keyword" value="'"/>
<elements xsi:type="xtext:Alternatives" cardinality="*">
<elements xsi:type="xtext:Group">
<elements xsi:type="xtext:Keyword" value="\"/>
<elements xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:Keyword" value="b"/>
<elements xsi:type="xtext:Keyword" value="t"/>
<elements xsi:type="xtext:Keyword" value="n"/>
<elements xsi:type="xtext:Keyword" value="f"/>
<elements xsi:type="xtext:Keyword" value="r"/>
<elements xsi:type="xtext:Keyword" value="u"/>
<elements xsi:type="xtext:Keyword" value="&quot;"/>
<elements xsi:type="xtext:Keyword" value="'"/>
<elements xsi:type="xtext:Keyword" value="\"/>
</elements>
</elements>
<elements xsi:type="xtext:NegatedToken">
<terminal xsi:type="xtext:Alternatives">
<elements xsi:type="xtext:Keyword" value="\"/>
<elements xsi:type="xtext:Keyword" value="'"/>
</terminal>
</elements>
</elements>
<elements xsi:type="xtext:Keyword" value="'"/>
</elements>
</alternatives>
</rules>
<rules xsi:type="xtext:TerminalRule" name="ML_COMMENT">
<type metamodel="/1/@metamodelDeclarations.0">
<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="/*"/>
<elements xsi:type="xtext:UntilToken">
<terminal xsi:type="xtext:Keyword" value="*/"/>
</elements>
</alternatives>
</rules>
<rules xsi:type="xtext:TerminalRule" name="SL_COMMENT">
<type metamodel="/1/@metamodelDeclarations.0">
<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="//"/>
<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="WS">
<type metamodel="/1/@metamodelDeclarations.0">
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</type>
<alternatives xsi:type="xtext:Alternatives" cardinality="+">
<elements xsi:type="xtext:Keyword" value=" "/>
<elements xsi:type="xtext:Keyword" value="&#x9;"/>
<elements xsi:type="xtext:Keyword" value="&#xD;"/>
<elements xsi:type="xtext:Keyword" value="&#xA;"/>
</alternatives>
</rules>
<rules xsi:type="xtext:TerminalRule" name="ANY_OTHER">
<type metamodel="/1/@metamodelDeclarations.0">
<classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</type>
<alternatives xsi:type="xtext:Wildcard"/>
</rules>
</xtext:Grammar>
</xmi:XMI>