eclipse - Xtext - Custom made terminal string without quotes -


i´m new xtext , have problem.

when try create terminal string without quotes eof errors.

if comment out code string without quotes i´dont error , works fine.

can explain me this? or give me hint how better solve this?

thank much

    // string without quotes terminal stringwq: ( ('a'..'z'|'a'..'z')('a'..'z' | 'a'..'z' | '_'| '-' | '§' | '?' | '!'| '@'                                         | '\n' | ':' |'%' | '.' | '*' | '^' | ',' | '&' | '('|')'| '0'..'9'|' ')*); 

rest of code

grammar org.xtext.example.mydsl.mydsl org.eclipse.xtext.common.terminals  generate mydsl "http://www.xtext.org/example/mydsl/mydsl"   model:     (elements += gitest)*  ;   gitest:     kwheader | kwtestcase ;  // keywords header kwheader:     'test' '!''?'     ;  kwtestcase:     'testcase' int=int ':' title = id |     'hello' names=id '!' ; 

update: data type rule

 qstring returns ecore::estring: //custom terminal surveystring         (('a'|'b'|'c'|'d'|'e'|'f'|'g'|'h'|'i'|'j'|'k'|'l'|'m'|'n'|'o'|'p'|'q'|'r'|'s'|'t'|'u'|'v'|'w'|'x'|'y'|'z'|            'a'|'b'|'c'|'d'|'e'|'f'|'g'|'h'|'i'|'j'|'k'|'l'|'m'|'n'|'o'|'p'|'q'|'r'|'s'|'t'|'u'|'v'|'w'|'x'|'y'|'z'|' ')           ('a'|'b'|'c'|'d'|'e'|'f'|'g'|'h'|'i'|'j'|'k'|'l'|'m'|'n'|'o'|'p'|'q'|'r'|'s'|'t'|'u'|'v'|'w'|'x'|'y'|'z'|            'a'|'b'|'c'|'d'|'e'|'f'|'g'|'h'|'i'|'j'|'k'|'l'|'m'|'n'|'o'|'p'|'q'|'r'|'s'|'t'|'u'|'v'|'w'|'x'|'y'|'z'|            ' '|'_'|'-'|'§'|'?'|'!'|'@'|'%'|'.'|'*'|'^'|','|'&'|'('|')'|'0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9')*); 

update 2:

got working data type rule und manipulating id

code:

stringwq: ((' ')?id)((id)?(int)? ' ' (id)?); terminal id: '^'?('a'..'z'|'a'..'z'|'_') ('a'..'z'|'a'..'z'|'_'|'0'..'9'|'/'|';'|','|'#'|'!'|'§'|'$'|'%'|'&'|               '('|')'|'='|'?'|'\\'|'*'|'+'|'.'|'-'|'>'|'<'|'|'|'['|']'|'{'|'}')*; 

but have problem xtext not recognizes when stringwq ends. dont keyword suggestions in next line. example if dont use stringwq int suggestions in next line. stringwq dont. how can define end of data type rules? thank you

your stringwq shadows terminal rule id , other rules including keywords. chances entire document consumed single terminal token of type stringwq. should try model string datatype rule.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -