Error "missing EOF at <token>" [message #1063740] |
Thu, 13 June 2013 21:32  |
Eclipse User |
|
|
|
Hi Team,
I'm trying to write xtext grammar for Salesforce SOSL language but bumping into an error. Sosl language reference is at http://www.salesforce.com/us/developer/docs/soql_sosl/
The usecase I'm trying is
and grammar I have so far is
grammar com.salesforce.dsl.sosl.Sosl hidden(WS, ML_COMMENT, SL_COMMENT)
import "http://www.eclipse.org/emf/2002/Ecore"
generate sosl "http://www.salesforce.com/dsl/sosl/Sosl"
SoslFile:
soslStatements+=SoslStatement*
;
SoslStatement:
'find' ('{' searchQuery=SearchQuery '}'|'\'' searchQuery=SearchQuery '\'')
;
SearchQuery:
terms+=SEARCH_WORD+
;
terminal ML_COMMENT:
'/*' -> '*/'
;
terminal SL_COMMENT:
'//' !('\n'|'\r')* ('\r'? '\n')?
;
terminal WS:
(' '|'\t'|'\r'|'\n')+
;
terminal SEARCH_WORD:
( '\\' SEARCH_RESERVED_CHARS | !SEARCH_RESERVED_CHARS)*
;
terminal fragment SEARCH_RESERVED_CHARS:
('?'|'&'|'|'|'!'|'{'|'}'|'['|']'|'('|')'|'~'|'*'|':'|'"'|'\''|'+'|'-'|'\\')
;
After compiling and running the app, I'm getting below error
Some Notes:
1. I'm not using Xtext default terminals but have copied applicable ones (WS, ML and SL Comment).
2. SEARCH_RESERVED_CHARS is fragment to parse information in this page http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_sosl_find.htm
Any help is appreciated.
Thanks,
Kumar
|
|
|
|
Re: Error "missing EOF at <token>" [message #1063765 is a reply to message #1063761] |
Fri, 14 June 2013 03:21  |
Eclipse User |
|
|
|
Hi Alex,
Thank you for the reply. I understand now about the lexing and how it would consume pretty much everything till first { and treat it as SEARCH_WORD.
Can you please advise how do I go about a grammar to parse an example like below?
FIND {MyProspect AND ("John Smith" OR MyCompany)}
Thanks,
Kumar
|
|
|
Powered by
FUDForum. Page generated in 0.03756 seconds