EcoreEnabledParser
abstract class EcoreEnabledParser<R : Node, P : Parser, C : ParserRuleContext, T : KolasuToken>(tokenFactory: TokenFactory<T>) : KolasuANTLRParser<R, P, C, T> , EMFMetamodelSupport
A Kolasu parser that supports exporting AST's to EMF/Ecore.
In particular, this parser can generate the metamodel. We can then use Node.toEObject to translate a tree into its EMF representation.
Functions
Link copied to clipboard
Implement this method to tell the parser how to generate the metamodel. See MetamodelBuilder. It does not actually save the resource.
Link copied to clipboard
Generates the metamodel. The standard Kolasu metamodel EPackage is included. It does not actually save the resource.
Link copied to clipboard
open override fun lex(inputStream: InputStream, charset: Charset, onlyFromDefaultChannel: Boolean): LexingResult<T>
Link copied to clipboard
open override fun parse(file: File, charset: Charset, considerRange: Boolean, measureLexingTime: Boolean): ParsingResult<R>
open override fun parse(code: String, considerRange: Boolean, measureLexingTime: Boolean, source: Source?): ParsingResultWithFirstStage<R, C>
fun parse(inputStream: CharStream, considerRange: Boolean, measureLexingTime: Boolean, source: Source?): ParsingResultWithFirstStage<R, C>
open fun parse(inputStream: InputStream, charset: Charset, considerRange: Boolean, measureLexingTime: Boolean, source: Source?): ParsingResult<R>
Link copied to clipboard
fun parseFirstStage(inputStream: CharStream, measureLexingTime: Boolean): FirstStageParsingResult<C>
fun parseFirstStage(file: File, charset: Charset, measureLexingTime: Boolean): FirstStageParsingResult<C>
fun parseFirstStage(inputStream: InputStream, charset: Charset, measureLexingTime: Boolean): FirstStageParsingResult<C>
Link copied to clipboard
fun processProperties(node: Node, propertyOperation: (PropertyDescription) -> Unit, propertiesToIgnore: Set<String>)
Link copied to clipboard
fun EMFMetamodelSupport.saveMetamodel(target: URI, options: Map<String, Boolean> = DEFAULT_OPTIONS_FOR_METAMODEL): Resource