Skip to content
Mathias Rieder edited this page Mar 10, 2017 · 2 revisions

Extend the grammar

grammar org.jnario.spec.Spec with org.jnario.xbase.richstring.XbaseWithRichstring

Use the Richstring rule somwhere

By default the XbaseWithRichstrings-grammar adds the Richstring rule to the XStringLiteral-Rule of Xbase XStringLiteral returns xbase::XExpression: SimpleStringLiteral | RichString;

Adapt your mwe2

Workflow {
...
    bean = StandaloneSetup {
    ...
    registerGenModelFile = "platform:/resource/org.jnario.xbase.richstring/model/XbaseRichString.genmodel"
}

bean = StandaloneSetup {
    ...
registerEcoreFile = "platform:/resource/org.jnario.xbase.richstring/model/XbaseRichString.ecore"
}

Important classes to extend

  • org.jnario.xbase.richstring.conversion.XbaseWithRichstringValueConverterService
  • org.jnario.xbase.richstring.XbaseWithRichstringCompiler
  • org.jnario.xbase.richstring.ui.highlighting.XbaseWithRichstringHighlightingCalculator
  • org.jnario.ui.highlighting.RichStringAwareTokenScanner (bind!)
  • org.jnario.ui.highlighting.TokenToAttributeIdMapper (bind!)
  • org.jnario.xbase.richstring.validation.XbaseWithRichstringJavaValidator