|
|
Re: Xtext newbie - ID with array declaration [message #1764367 is a reply to message #1764365] |
Mon, 29 May 2017 08:56 |
Anton Hughes Messages: 66 Registered: January 2013 |
Member |
|
|
Hi Christian
Apologies for the lack of details.
Dsl
My dsl, currently, looks like this:
struct MyStruct{
int myInt;
unsigned int myUnsiggnedInt;
__time32_t timestamp;
char myChar[32];
};
Xtext
And my xtext file is:
grammar mydomain.Mydsl with org.eclipse.xtext.common.Terminals
generate Mydsl "http://mydomain/mydsl"
Model:
structs+=struct*;
struct:
'struct' name=ID '{'
attributes+=Attribute*
'};';
Attribute:
type=AttributeType name=ID ';';
AttributeType:
elementType=ElementType (array?='[' (length=INT)? ']')?;
ElementType:
BasicType | StructType;
BasicType:
typeName=('string' | 'int' | 'boolean' | 'char' | '__time32_t' | 'unsigned int');
StructType:
struct=[struct];
Problem
The dsl is currently unable to parse the following line:
[Updated on: Mon, 29 May 2017 08:57] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05296 seconds