Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Can't find cause of warning(200)in code generation
icon9.gif  Can't find cause of warning(200)in code generation [message #639956] Thu, 18 November 2010 14:28 Go to next message
Kai Maschke is currently offline Kai MaschkeFriend
Messages: 16
Registered: October 2010
Junior Member
Hi,

while testing my grammar it happens that I get an error, that the grammar expects something, that I wasn't expecting Wink
The error says:
Quote:
"mismatched input 'arg-restriction' expecting EOF"

So I thought that the warning during the code generation might have something to do with it. The warning:
Quote:
warning(200): ../de.saintmetais.transformation.dsl.ui/src-gen/de/saintmeta is/transformation/ui/contentassist/antlr/internal/InternalR2 O.g:2321:39: Decision can match input such as "'arg-restriction'" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input


But I really don't find out why the warning is being raised! Might someone have a look at my grammar and tell me what I am doing wrong?
An instance should look like this:
conceptmap-def
	name 'name'
	identified-by "Identifier"
	uri-as 
		concat
			arg-restriction
				on-param "Paramname"
				has-column "Hascol"
			arg-restriction
				on-param "Paramname"
				has-transform
					get_substring
						arg-restriction
							on-param "Paramname"
							has-value 0
						arg-restriction
							on-param "Paramname"
							has-value 1
						arg-restriction
							on-param "Paramname"
							has-column "Hascol"
	applies-if
		equals_str
			arg-restriction
				on-param "Paramname"
				has-column "Hascol"
			arg-restriction
				on-param "Paramname"
				has-value "bla"

The error is shown at the third "arg-restriction"


My grammar:
ConceptmappingDefinition:
	'conceptmap-def' name=ConceptMapName
	(idents+=IdentifiedBy)+ 
	(uriases=UriAs)?
	//	(propmapdefs+=PropertymapDefEntity)*
	(appliesIf=AppliesIf)? (joinsVia=JoinsVia)?;

ConceptMapName:
	'name' name=STRING;

AppliesIf:
	'applies-if' cond=AndcondExpr;

JoinsVia:
	'joins-via' joinlist=JoinList;

UriAs:
	'uri-as' trans=Transformation;

IdentifiedBy:
	'identified-by' identifier=STRING;

Transformation:
	primTrans=PrimitiveTransformation (res+=ArgRestriction)*;
	
ArgRestriction:
	'arg-restriction' paramselctor=ParameterSelector res=Restriction;
	
PrimitiveTransformation:
	GetNthChar | GetDelimited | GetSubstring | 
	Concat | AddType | SubstractType |
	MultiplyType | DivideType;

GetNthChar returns STRING:
	{EString} 'get_nth_char';

GetDelimited returns STRING:
	{EString} 'get_delimited';
	
GetSubstring returns STRING:
	{EString} 'get_substring';
	
Concat returns STRING:
	{EString} 'concat';
	
AddType returns STRING:
	{EString} 'add_type';
	
SubstractType returns STRING:
	{EString} 'substract_type';
	
MultiplyType returns STRING:
	{EString} 'multiplyType';
	
DivideType returns STRING:
	{EString} 'divide_type';

terminal DOUBLE returns ecore::EDouble : 
	'1'..'9' ('0'..'9')* ('.' '0'..'9'+)? (('E' | 'e') ('+' | '-')? '0'..'9'+)?
	| '0' ('.' '0'..'9'+)? (('E' | 'e') ('+' | '-')? '0'..'9'+)? ;

JoinList:
	('hasjoin' hascols+=HasCol)+ ('overwrites' overwriting=STRING)?;

HasCol:
	'hasCol' col=STRING;
	
AndcondExpr returns CondExpr:
	OrcondExpr ({AndcondExpr.left=current} 'AND' right=OrcondExpr)*;

OrcondExpr returns CondExpr:
	NotcondExpr ({OrcondExpr.left=current} 'OR' right=NotcondExpr)*;
	
NotcondExpr returns CondExpr:
	Condition | 'NOT' Condition;
	
Condition returns BOOLEAN:
	PrimitiveCondition (argRes+=ArgRestriction)+;
	
PrimitiveCondition returns BOOLEAN:
	LoThan | LoorequalThan | LoThanStr |
	LoorequalThanStr | HiThan | HiorequalThan |
 	HiThanStr | HiorequalThanStr |
	Equals | EqualsStr | InKeyword |
	Between | BetweenStr | DateBefore |
	DateAfter | DateEqual;
	
LoThan returns BOOLEAN:
	{BOOLEAN}'lo_than';

LoorequalThan returns BOOLEAN:
	{BOOLEAN}'loorequal_than';
	
LoThanStr returns BOOLEAN:
	{BOOLEAN}'lo_than_str';
	
LoorequalThanStr returns BOOLEAN:
	{BOOLEAN}'loorequal_than_str';

HiThan returns BOOLEAN:
	{BOOLEAN}'hi_than';

HiorequalThan returns BOOLEAN:
	{BOOLEAN}'hiorequal_than';
	
HiThanStr returns BOOLEAN:
	{BOOLEAN}'hi_than_str';
	
HiorequalThanStr returns BOOLEAN:
	{BOOLEAN}'hiorequal_than_str';

Equals returns BOOLEAN:
	{BOOLEAN}'equals';
	
EqualsStr returns BOOLEAN:
	{BOOLEAN}'equals_str';
	
InKeyword returns BOOLEAN:
	{BOOLEAN}'in_keyword';

Between returns BOOLEAN:
	{BOOLEAN}'between';

BetweenStr returns BOOLEAN:
	{BOOLEAN}'between_str';
	
DateBefore returns BOOLEAN:
	{BOOLEAN}'date_before';
	
DateAfter returns BOOLEAN:
	{BOOLEAN}'date_after';

DateEqual returns BOOLEAN:
	{BOOLEAN}'date_equal';

ParameterSelector:
	'on-param' paramname=STRING;

Restriction:
	ValueRestriction | ColumnRestriction| TransformationRestriction;

ValueRestriction:
	'has-value' constantvalue=ConstantValue;
	
ColumnRestriction:
	'has-column' hascol=STRING;
	
TransformationRestriction:
	'has-transform' trans=Transformation;
	
ConstantValue:
	Datatype (StringLiteral | NumberLiteral);
	
StringLiteral:
	value=STRING;	
	
NumberLiteral:
	value=DOUBLE;

Datatype:
	'string' | 'boolean' | 'decimal' | 'float' | 'double' | 'date' | 'integer';


Please help!
Re: Can't find cause of warning(200)in code generation [message #640153 is a reply to message #639956] Fri, 19 November 2010 11:13 Go to previous message
Kai Maschke is currently offline Kai MaschkeFriend
Messages: 16
Registered: October 2010
Junior Member
Solved it myself by using the trackback option.
Previous Topic:XText memory use (1000 models)
Next Topic:Exception on Open File...
Goto Forum:
  


Current Time: Fri Apr 26 12:51:26 GMT 2024

Powered by FUDForum. Page generated in 0.03266 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top