Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2t-dev] Extraneous input; expecting RULE_ID

Hi Hamzat,

please ask Xtext related questions in the newsgroup / forum: http://www.eclipse.org/forums/index.php?t=thread&frm_id=27

You model seems to mix the abstract and the concrete syntax. E.g. if you define 

AtomicModel: name = ID ;

a valid model would be 

SomeID 

but what you try to write all over the place is

Name SomeID

There is no need to repeat the names of the assigned features. That's what the parser will do for you. Please refer to the Xtext documentation for details.

Regards,
Sebastian


On 05.10.2011, at 08:36, Hamzat Aliyu wrote:


 Hi All,
I just created a dsl in xtext after going through the xtext sample model in eclipse, everything seemed to have worked fine when I wrote the xtend parser but when i used run as eclipse application to create a model i was getting the error stated above.

below are my entire grammar and the model i created.
[CODE]
grammar org.xtext.learning.devs.DEVS1 with org.eclipse.xtext.common.Terminals

generate dEVS1 "http://www.xtext.org/learning/devs/DEVS1"

Model:{Model}
    model = CoupledModel
;

CoupledModel:
    name = ID
    ('inputList'
        iPorts += InputPort*
     'endList'
    )?
    ('ouputList'
        oPorts += OutputPort*
     'endList'
    )?
    'atomList'
        atoms += AtomicModel+
    'endList'
;

AtomicModel:
    name = ID
    ('inputList'
        iPorts += InputPort*
     'endList'
    )?
    ('ouputList'
        oPorts += OutputPort*
     'endList'
    )?
    'stateList'
        states +=State+
    'endList'
;

InputPort:
    portName = ID
    portType = ID
;

OutputPort:
    portName = ID
    portType = ID
;

State:
    stateName = ID
    timeAdvance = ID
;
[/CODE]

Below is the instance model created in new eclipse project
[CODE]
Model
atomList
Name model1
inputList
portName inport1
portName inport2
endList
ouputList
portName outport1
portType int
portName outport2
portType String
endList
stateList
stateName idle
timeAdvance _23
stateName active
timeAdvance _12
endList
endList
[/CODE]

Your please help me out.
Thank you

_______________________________________________
m2t-dev mailing list
m2t-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2t-dev


Back to the top