FormalADL / kAADL

1 stars 1 forks source link

Errors about "krun --backend java *.aadl" #6

Closed suweining closed 9 years ago

suweining commented 9 years ago

Here are the non-terminals in the error logs of "krun --backend java *.aadl"

1) error non-terminals : FlowFetIdentifer, UniPortId, CmpImplName, ParameterRef, FetGroupRef, CalledSubPgm, FetRef, SubCmpFlowId, PlatformClassifierRef, ContainedModelElementList, PortConnectionRefence, AccessRef

in the test files:

AbstractComponents.aadl SystemBinding.aadl BusComponentAccess.aadl SubprogramsAndSubprogramCalls.aadl PropertyExpressions.aadl Ports.aadl PortConnections.aadl ModesAndModeTransitions.aadl FlowImplementations.aadl EndToEndFlows.aadl DataComponentAccess.aadl ComponentImplementations.aadl

2) error non-terminals : RecordFieldIdIdList, PpeAssoc, BasicPpeAssoc

in the test files:

Packages.aadl SubprogramGroupsAndSubprogramGroupTypes.aadl FeatureGroupConnections.aadl

3) error non-terminals : Mvirtual, Mvirtrual

in the test file:VirtualBuses.aadl

4) error non-terminals : RealRange, RealRangeTerm

in the test file:PropertyTypes.aadl

5) error non-terminals : ConstantPpeExpression, DefaultPpeExpression, PpeListValue, UnitsList

in the test file:PropertyDefinitions.aadl

6) error non-terminals : Mrequires, Mrequirs

in the test files:

Memory.aadl Devices.aadl ComponentTypes.aadl

7) error non-terminals : FetGroupTypeAssocDefElem, FetGroupTypeExtAssocDefElem, InverseOfUniProtoType

in the test file:FeatureGroupsAndFeatureGroupTypes.aadl

in the test file:FeatureGroupConnections.aadl

ps.the error messages are not posted.

suweining commented 9 years ago

A hint from error 3): It's my careless that our project have the macro of Mvirtrual which is caused by clerical error.In the macro.k, these two none-terminals,Mvirtual and Mvirtrual,point to the same terminal "virtual". So,I guess that the reason of these errors may be that two or more none-terminals can infer the same termianl,such as syntax Mvirtual ::= "virtual" while syntax Mvirtrual ::= "virtual".

Error 6) is same to error 3)!

Lets talk about error 2):error non-terminals :RecordFieldIdIdList, PpeAssoc, BasicPpeAssoc

the syntax of RecordFieldIdIdList: syntax RecordFieldIdIdList ::= Id MRoughArrow PpeValue MSemicolon | Id MRoughArrow PpeValue MSemicolon RecordFieldIdIdList

the syntax of BasicPpeAssoc: syntax BasicPpeAssoc ::= UniPpeId MRoughArrow Mconstant PpeValue MSemicolon | UniPpeId MRoughArrow PpeValue MSemicolon | UniPpeId MPlusRoughArrow Mconstant PpeValue MSemicolon | UniPpeId MPlusRoughArrow PpeValue MSemicolon

The same defination is : UniPpeId(Id) MRoughArrow PpeValue MSemicolon

the syntax of PpeAssoc: syntax PpeAssoc ::= UniPpeId MRoughArrow Mconstant Assignment InBinding MSemicolon | UniPpeId MRoughArrow Mconstant Assignment MSemicolon | UniPpeId MRoughArrow Assignment InBinding MSemicolon | UniPpeId MRoughArrow Assignment MSemicolon | UniPpeId MPlusRoughArrow Mconstant Assignment InBinding MSemicolon | UniPpeId MPlusRoughArrow Mconstant Assignment MSemicolon | UniPpeId MPlusRoughArrow Assignment InBinding MSemicolon | UniPpeId MPlusRoughArrow Assignment MSemicolon

the same defination : UniPpeId MRoughArrow Assignment MSemicolon (while syntax Assignment ::= PpeValue )

suweining commented 9 years ago

solution to Error 4) :

The error non-terminals' defination is :

syntax RealRange ::= SignedAadlrealOrConstant MDoubleDiont SignedAadlrealOrConstant

syntax RealRangeTerm ::= RealTerm MDoubleDiont RealTerm | RealTerm MDoubleDiont RealTerm Mdelta RealTerm | RealRangePpeConstantTerm syntax RealTerm::= SignedAadlrealOrConstant .

The same product :SignedAadlrealOrConstant MDoubleDiont SignedAadlrealOrConstant

The solution is that add the RealRange to defination of RealRangeTerm : syntax RealRangeTerm ::= RealRange // RealTerm MDoubleDiont RealTerm | RealTerm MDoubleDiont RealTerm Mdelta RealTerm | RealRangePpeConstantTerm

Kompile and krun this test file again. The new error non-terminal : ConstantPpeExpression, DefaultPpeExpression, PpeListValue, UnitsList

It is error 5) !

suweining commented 9 years ago

Error 8):

Remove the macro "Mvirtrual" from project and we get a new error from this test file:

ClassifierType, CmpClassifierTerm

It is the new error from error 3):

error non-terminals :

ClassifierType, CmpClassifierTerm

in the test file:VirtualBuses.aadl

suweining commented 9 years ago

Solution to error 6) : Remove the macro "Mrequirs" from project and we get a new error from this test file:

FlowFetIdentifer, UniPortId, CmpImplName, ParameterRef, FetGroupRef, CalledSubPgm, FetRef, SubCmpFlowId, PlatformClassifierRef, ContainedModelElementList, PortConnectionRefence, AccessRef

It is error 1) !

suweining commented 9 years ago

Solution to error 1) :

Add a file named "Ambiguity.k" to define the repitation of the same product.

The resean of error 1) is about "Id MPoint Id".Lots of non-terminal are defined as "Id MPoint Id".So define the "Id MPoint Id "in Ambiguity.k:

    syntax AmbIdPointId ::=  Id | Id MPoint Id

And replace "Id MPoint Id" in the project.

change " syntax PortConnectionRefence ::= Id | Id MPoint Id | Mself MPoint Id " to " syntax PortConnectionRefence ::= AmbIdPointId | Mself MPoint Id " And our project has some error similar to 1) such as the defination of " Mprocessor MPoint Id" and "Id | Id MDoubleColon Id" .

suweining commented 9 years ago

Solution to error 2): Get the definations of the non-terminal :

syntax RecordFieldIdIdList ::= Id MRoughArrow PpeValue MSemicolon | Id MRoughArrow PpeValue MSemicolon RecordFieldIdIdList

syntax PpeAssoc ::= UniPpeId MRoughArrow Mconstant Assignment InBinding MSemicolon | UniPpeId MRoughArrow Mconstant Assignment MSemicolon | UniPpeId MRoughArrow Assignment InBinding MSemicolon | UniPpeId MRoughArrow Assignment MSemicolon | UniPpeId MPlusRoughArrow Mconstant Assignment InBinding MSemicolon | UniPpeId MPlusRoughArrow Mconstant Assignment MSemicolon | UniPpeId MPlusRoughArrow Assignment InBinding MSemicolon | UniPpeId MPlusRoughArrow Assignment MSemicolon syntax Assignment ::= PpeValue | ModalPpeValue

syntax BasicPpeAssoc ::= UniPpeId MRoughArrow Mconstant PpeValue MSemicolon | UniPpeId MRoughArrow PpeValue MSemicolon | UniPpeId MPlusRoughArrow Mconstant PpeValue MSemicolon | UniPpeId MPlusRoughArrow PpeValue MSemicolon The product,UniPpeId MRoughArrow PpeValue MSemicolon,appears in this three non-terminal. Solution: Define syntax syntax AmbIdRoughArrowPpeValue ::= UniPpeId MRoughArrow PpeValue MSemicolon in Ambiguity.k .And replace relevant defination by AmbIdRoughArrowPpeValue .