Internal language parser is not found in xtext project [message #1764235] |
Fri, 26 May 2017 23:47  |
Eclipse User |
|
|
|
When I am trying to convert an Antlr written grammar file to Xtext some times it complains with this error when generating xtext artifacts. My grammar file is a bit large and once it gave a heap memory error and I allocated 1024MB for heap. Is the above mentioned error occurred due to false conversions? But I feel the conversions should be fine.
For instance an antlr written rule like
partition
: annotation* PARTITION WITH '('partition_with_stream (','partition_with_stream)* ')' BEGIN (query|error) (';' (query|error))* ';'? END
;
should be converted in the same way to Xtext grammar as far as I know. Does anyone having an idea why this error is coming?
The whole error is:
[main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems running workflow org.xtext.example.siddhiql.GenerateSiddhiQL:
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: XtextGenerator)
org.eclipse.xtext.util.RuntimeIOException: java.io.FileNotFoundException: C:\Users\Udeshika\workspace\org.example.siddhi\..\org.example.siddhi.ide\src-gen\org\xtext\example\siddhiql\ide\contentassist\antlr\internal\InternalSiddhiQLParser.java (The system cannot find the file specified)
at org.eclipse.xtext.generator.JavaIoFileSystemAccess.readTextFile(JavaIoFileSystemAccess.java:257)
at org.eclipse.xtext.generator.AbstractFileSystemAccess2.readTextFile(AbstractFileSystemAccess2.java:45)
at org.eclipse.xtext.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment2.improveCodeQuality(AbstractAntlrGeneratorFragment2.java:225)
at org.eclipse.xtext.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment2.splitParserAndLexerIfEnabled(AbstractAntlrGeneratorFragment2.java:213)
at org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2.generateContentAssistGrammar(XtextAntlrGeneratorFragment2.java:199)
at org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2.doGenerate(XtextAntlrGeneratorFragment2.java:156)
at org.eclipse.xtext.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment2.generate(AbstractAntlrGeneratorFragment2.java:109)
at org.eclipse.xtext.xtext.generator.CompositeGeneratorFragment2.generate(CompositeGeneratorFragment2.java:48)
at org.eclipse.xtext.xtext.generator.XtextGenerator.invokeInternal(XtextGenerator.java:212)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
Caused by: java.io.FileNotFoundException: C:\Users\Udeshika\workspace\org.example.siddhi\..\org.example.siddhi.ide\src-gen\org\xtext\example\siddhiql\ide\contentassist\antlr\internal\InternalSiddhiQLParser.java (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at com.google.common.io.Files$FileByteSource.openStream(Files.java:127)
at com.google.common.io.Files$FileByteSource.openStream(Files.java:117)
at com.google.common.io.ByteSource.read(ByteSource.java:265)
at com.google.common.io.Files$FileByteSource.read(Files.java:144)
at com.google.common.io.Files.toByteArray(Files.java:377)
at org.eclipse.xtext.generator.JavaIoFileSystemAccess.readTextFile(JavaIoFileSystemAccess.java:253)
... 18 more
java.lang.RuntimeException: Problems running workflow org.xtext.example.siddhiql.GenerateSiddhiQL:
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: XtextGenerator)
org.eclipse.xtext.util.RuntimeIOException: java.io.FileNotFoundException: C:\Users\Udeshika\workspace\org.example.siddhi\..\org.example.siddhi.ide\src-gen\org\xtext\example\siddhiql\ide\contentassist\antlr\internal\InternalSiddhiQLParser.java (The system cannot find the file specified)
at org.eclipse.xtext.generator.JavaIoFileSystemAccess.readTextFile(JavaIoFileSystemAccess.java:257)
at org.eclipse.xtext.generator.AbstractFileSystemAccess2.readTextFile(AbstractFileSystemAccess2.java:45)
at org.eclipse.xtext.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment2.improveCodeQuality(AbstractAntlrGeneratorFragment2.java:225)
at org.eclipse.xtext.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment2.splitParserAndLexerIfEnabled(AbstractAntlrGeneratorFragment2.java:213)
at org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2.generateContentAssistGrammar(XtextAntlrGeneratorFragment2.java:199)
at org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2.doGenerate(XtextAntlrGeneratorFragment2.java:156)
at org.eclipse.xtext.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment2.generate(AbstractAntlrGeneratorFragment2.java:109)
at org.eclipse.xtext.xtext.generator.CompositeGeneratorFragment2.generate(CompositeGeneratorFragment2.java:48)
at org.eclipse.xtext.xtext.generator.XtextGenerator.invokeInternal(XtextGenerator.java:212)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
Caused by: java.io.FileNotFoundException: C:\Users\Udeshika\workspace\org.example.siddhi\..\org.example.siddhi.ide\src-gen\org\xtext\example\siddhiql\ide\contentassist\antlr\internal\InternalSiddhiQLParser.java (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at com.google.common.io.Files$FileByteSource.openStream(Files.java:127)
at com.google.common.io.Files$FileByteSource.openStream(Files.java:117)
at com.google.common.io.ByteSource.read(ByteSource.java:265)
at com.google.common.io.Files$FileByteSource.read(Files.java:144)
at com.google.common.io.Files.toByteArray(Files.java:377)
at org.eclipse.xtext.generator.JavaIoFileSystemAccess.readTextFile(JavaIoFileSystemAccess.java:253)
... 18 more
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:104)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
Caused by: java.lang.RuntimeException:
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: XtextGenerator)
org.eclipse.xtext.util.RuntimeIOException: java.io.FileNotFoundException: C:\Users\Udeshika\workspace\org.example.siddhi\..\org.example.siddhi.ide\src-gen\org\xtext\example\siddhiql\ide\contentassist\antlr\internal\InternalSiddhiQLParser.java (The system cannot find the file specified)
at org.eclipse.xtext.generator.JavaIoFileSystemAccess.readTextFile(JavaIoFileSystemAccess.java:257)
at org.eclipse.xtext.generator.AbstractFileSystemAccess2.readTextFile(AbstractFileSystemAccess2.java:45)
at org.eclipse.xtext.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment2.improveCodeQuality(AbstractAntlrGeneratorFragment2.java:225)
at org.eclipse.xtext.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment2.splitParserAndLexerIfEnabled(AbstractAntlrGeneratorFragment2.java:213)
at org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2.generateContentAssistGrammar(XtextAntlrGeneratorFragment2.java:199)
at org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2.doGenerate(XtextAntlrGeneratorFragment2.java:156)
at org.eclipse.xtext.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment2.generate(AbstractAntlrGeneratorFragment2.java:109)
at org.eclipse.xtext.xtext.generator.CompositeGeneratorFragment2.generate(CompositeGeneratorFragment2.java:48)
at org.eclipse.xtext.xtext.generator.XtextGenerator.invokeInternal(XtextGenerator.java:212)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
Caused by: java.io.FileNotFoundException: C:\Users\Udeshika\workspace\org.example.siddhi\..\org.example.siddhi.ide\src-gen\org\xtext\example\siddhiql\ide\contentassist\antlr\internal\InternalSiddhiQLParser.java (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at com.google.common.io.Files$FileByteSource.openStream(Files.java:127)
at com.google.common.io.Files$FileByteSource.openStream(Files.java:117)
at com.google.common.io.ByteSource.read(ByteSource.java:265)
at com.google.common.io.Files$FileByteSource.read(Files.java:144)
at com.google.common.io.Files.toByteArray(Files.java:377)
at org.eclipse.xtext.generator.JavaIoFileSystemAccess.readTextFile(JavaIoFileSystemAccess.java:253)
... 18 more
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.handleIssues(Mwe2Bridge.java:56)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:48)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
... 4 more
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Internal language parser is not found in xtext project [message #1764445 is a reply to message #1764443] |
Mon, 29 May 2017 16:55   |
Eclipse User |
|
|
|
once again. having a minimal grammar for the query part as well would help.
e.g
query_section:
{query_section}(SELECT ('*'| (out_att += output_attribute (',' out_att +=output_attribute)* )) (grp_by=group_by)? (having=having_expr)?)
;
output_attribute:
{output_attribute} attr=attribute INSERT (att_name +=attribute_name) | {output_attribute} attr_ref=attribute_reference
;
group_by:
GROUP BY attr_ref+=attribute_reference (',' attr_ref+=attribute_reference)*
;
having_expr:
HAVING expr=expression
;
attribute_index:
INT_LITERAL| LAST ('-' INT_LITERAL)?
;
expression:
literal
;
attribute:
literal
;
attribute_reference:
{attribute_reference} hash1='#'? name1=name ('['attribute_index1=attribute_index']')? (hash2='#' name2=name ('['attribute_index2=attribute_index']')?)? '.' attribute_name
|{attribute_reference} attribute_name
;
literal:
{function_operation} constant_value
|{function_operation} attr_ref=attribute_reference
;
constant_value:
string_value
| time_value
;
time_value:
year_value
;
year_value:
INT_LITERAL YEARS
;
string_value:
STRING_LITERAL
;
INT_LITERAL :
DIGIT
;
STRING_LITERAL:
STRING
;
fragment DIGIT:
INT
;
name:
keyword | ID
;
attribute_name:
name
;
which gives some warnings with an understandable message as well
warning(200): ../org.xtext.example.mydsl1/src-gen/org/xtext/example/mydsl1/parser/antlr/internal/InternalMyDsl.g:719:2: Decision can match input such as "RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../org.xtext.example.mydsl1.ide/src-gen/org/xtext/example/mydsl1/ide/contentassist/antlr/internal/InternalMyDsl.g:1363:1: Decision can match input such as "RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
=> i can help you only if you help me to understand your problem based on a small example.
+ e.g. a bunch of unit tests
but if you have a look at
output_attribute:
{output_attribute} attr=attribute INSERT (att_name +=attribute_name) | {output_attribute} attr_ref=attribute_reference
you can see that after the INSERT can only come one attribute name but
insert all events into outputStream ;
are 4 things after insert
maybe that should be parsed as
query_output:
INSERT (out_event_type = output_event_type)? INTO (tar = target)
;
but i dont know
.....
so it might be ambigous in conj with
query:
(ann3 += annotation)* FROM (q_inp = query_input ) (query_sec = query_section)? (q_output = query_output)';'
;
..........
what should go into section and what into output.?
;
a grammar like
model:
s=query_section? (q_output = query_output)';'
;
query_output:
INSERT (out_event_type = output_event_type)? INTO (tar = target);
output_event_type:
ALL EVENTS | ALL RAW EVENTS | EXPIRED EVENTS | EXPIRED RAW EVENTS | CURRENT? EVENTS;
query_section:
{query_section}(SELECT ('*'| (out_att += output_attribute (',' out_att +=output_attribute)* ))
//(grp_by=group_by)? (having=having_expr)?
)
;
source:
inner='#'? (str_id = stream_id)
;
stream_id:
name
;
target:
source
;
output_attribute:
{output_attribute} attr=attribute INSERT (att_name +=attribute_name) | {output_attribute} attr_ref=attribute_reference
;
group_by:
GROUP BY attr_ref+=attribute_reference (',' attr_ref+=attribute_reference)*
;
having_expr:
HAVING expr=expression
;
attribute_index:
INT_LITERAL| LAST ('-' INT_LITERAL)?
;
expression:
literal
;
attribute:
literal
;
attribute_reference:
{attribute_reference} hash1='#'? name1=name ('['attribute_index1=attribute_index']')? (hash2='#' name2=name ('['attribute_index2=attribute_index']')?)? '.' attribute_name
|{attribute_reference} attribute_name
;
literal:
{function_operation} constant_value
|{function_operation} attr_ref=attribute_reference
;
constant_value:
string_value
| time_value
;
time_value:
year_value
;
year_value:
INT_LITERAL YEARS
;
string_value:
STRING_LITERAL
;
INT_LITERAL :
DIGIT
;
STRING_LITERAL:
STRING
;
fragment DIGIT:
INT
;
name:
keyword | ID
;
attribute_name:
name
;
looks ok but gives warnings as well
=>
i recommend to work with smaller grammars, avoid backtracking to nail down the issue
|
|
|
|
|
|
|
|
|