Community
Participate
Working Groups
Build Identifier: I20100608-0911 I have a terminal rule: terminal WS: (' ' | '\t' | '\f')+; When running the workflow to generate the XText editor I get a: ... 449 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning /home/mark.christiaens/workspace_sigasi_vhdl/com.sigasi.xtext/../com.sigasi.xtext.ui/src-gen 574 [main] INFO ipse.xtext.generator.LanguageConfig - generating infrastructure for com.sigasi.xtext.VHDLLang with fragments : ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment, EcoreGeneratorFragment, ParseTreeConstructorFragment, ResourceFactoryFragment, XtextAntlrGeneratorFragment, JavaValidatorFragment, ImportNamespacesScopingFragment, QualifiedNamesFragment, BuilderIntegrationFragment, FormatterFragment, LabelProviderFragment, TransformerFragment, OutlineNodeAdapterFactoryFragment, QuickOutlineFragment, QuickfixProviderFragment, JavaBasedContentAssistFragment, XtextAntlrUiGeneratorFragment 2494 [main] ERROR enerator.CompositeGeneratorFragment - An invalid XML character (Unicode: 0xc) was found in the element content: java.lang.RuntimeException: An invalid XML character (Unicode: 0xc) was found in the element content: at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl$Escape.convert(XMLSaveImpl.java:3298) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.getDatatypeValue(XMLSaveImpl.java:3082) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveDataTypeSingle(XMLSaveImpl.java:1678) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1265) at ... org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52) at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74) at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35) 4348 [main] INFO or.validation.JavaValidatorFragment - executing generate for org.eclipse.xtext.generator.validation.JavaValidatorFragment 5201 [main] INFO .emf.mwe2.runtime.workflow.Workflow - Done. The workflow does seem to execute to the end succesfully. The cause is the form feed character '\f' in the rule. Any suggestions how to avoid this problem? Reproducible: Always
Workaround: Use XML 1.1 by setting the xmlVersion like this: fragment = grammarAccess.GrammarAccessFragment { xmlVersion = "1.1" }
We should provide a switch in grammarAccess.GrammarAccessFragment to use BinaryResource instead of what is registered with *.xmi file extension. Also a corresponding GrammarProvider should be available in that case.
FYI, When I enable XML 1.1 I also ran into the issue described here: http://www.eclipse.org/forums/index.php?t=tree&th=173813&S=35669656837b43154c1790271f5a797a I've reverted back to not supporting form-feeds in my lexer for the time being and using XML 1.0.
I just tried enabling the form feed character on Xtext 2.0 M4 and got ... 8448 ERROR CompositeGeneratorFragment - An invalid XML character (Unicode: 0xc) was found in the element content: java.lang.RuntimeException: An invalid XML character (Unicode: 0xc) was found in the element content: at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl$Escape.convert(XMLSaveImpl.java:3298) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.getDatatypeValue(XMLSaveImpl.java:3082) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveDataTypeSingle(XMLSaveImpl.java:1678) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1265) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2685) ... So I guess this issue is still present.
Ed is working on an optimized persistence format for the index structure.
(In reply to comment #5) > Ed is working on an optimized persistence format for the index structure. This was obviously the wrong ticket for this comment :-) Anyway, we'll look into binary storage of the grammar model to improve the startup time.
*** Bug 406684 has been marked as a duplicate of this bug. ***
we discussed internally to introduce binary resource for the persisted XtextGrammar: The GrammarProvider should: - check if there is a binary resource, and if so, load it. - otherwise load the XMI. The GrammarAccessFragment should: - save a XMI, if GrammarAccessFragment.setXmlVersion(String) has been set. - save a binary resource otherwise. - log a warning message, if XMI is being saved. proposed file extension for binary Xtext grammars: *.xtextbin
Created attachment 230300 [details] XtendGrammarAccess with XMIResource
Created attachment 230301 [details] XtendGrammarAccess with BinaryResource
I pushed the patch to Gerrit: https://git.eclipse.org/r/#/c/12385/ Loading time from XtendGrammrAccess decreases from 171 ms to 52 ms. However, that's just a small drop in the ocean compared to the total injector initialization time.
fixed in 'master'. please note that you'll need to regenerate your language to benefit from this improvement.