DialectService¶
-
public class
DialectService
implements IDialectService¶ Default implementation for the dialect service. It is mostly generic, but contains some logic for .meta files, which are Spoofax-specific. A dialect is simply a language implementation, with a single component, that mimics its base language, but has a different name and a few different facets. Dialects are created by copying over all facets from a language implementation into a new language implementation, except that:
ResourceExtensionFacet
: removed to prevent dialects from overriding an extension of the base language.IdentificationFacet
: wrapped byMetaFileIdentifier
such that files without a corresponding .meta file do not identify to the dialect.SyntaxFacet
: replaced by the dialect’s syntax facet that uses a different parse table.
Constructors¶
DialectService¶
-
public
DialectService
(ILanguageService languageService)¶
Methods¶
add¶
-
public ILanguageImpl
add
(String name, FileObject location, ILanguageImpl base, IFacet syntaxFacet)¶
dialectName¶
-
public String
dialectName
(ILanguageImpl dialect)¶
getBase¶
-
public ILanguageImpl
getBase
(ILanguageImpl dialect)¶
getDialect¶
-
public ILanguageImpl
getDialect
(String name)¶
getDialects¶
-
public Iterable<ILanguageImpl>
getDialects
(ILanguageImpl base)¶
remove¶
-
public ILanguageImpl
remove
(String name)¶
remove¶
-
public Iterable<ILanguageImpl>
remove
(ILanguageImpl base)¶
update¶
-
public ILanguageImpl
update
(String name, IFacet syntaxFacet)¶
update¶
-
public Iterable<ILanguageImpl>
update
(ILanguageImpl base)¶