IDialectService¶
-
public interface
IDialectService
¶
Methods¶
add¶
-
ILanguageImpl
add
(String name, FileObject location, ILanguageImpl base, IFacet syntaxFacet)¶ Creates a new dialect language for given base language and parser facet. The dialect replaces the parser facet, and retains all other facets of the base language.
Parameters: - name – Name of the new dialect language.
- location – Location of the new dialect language.
- base – Base language of the dialect.
- syntaxFacet – Syntax facet to replace the base language’s syntax facet with.
Throws: - MetaborgRuntimeException – When dialect with given name already exists.
Returns: Created dialect language.
dialectName¶
-
String
dialectName
(ILanguageImpl dialect)¶ Returns dialect name for the given dialect.
Parameters: - dialect – The dialect.
Returns: the name of the dialect, null if it isn’t a dialect.
getBase¶
-
ILanguageImpl
getBase
(ILanguageImpl dialect)¶ Gets the base language for given dialect.
Parameters: - dialect – Dialect to get base language for.
Returns: Base language of given dialect, or null if given language is not a dialect or the dialect has been removed.
getDialect¶
-
ILanguageImpl
getDialect
(String name)¶ Gets dialect language with given name.
Parameters: - name – Name of the dialect to get.
Returns: Dialect language with given name, or null if it does not exist.
getDialects¶
-
Iterable<ILanguageImpl>
getDialects
(ILanguageImpl base)¶ Gets all dialects for given base language
Parameters: - base – Base language of the dialects.
Returns: Dialects for given base language.
hasDialect¶
remove¶
-
ILanguageImpl
remove
(String name)¶ Removes dialect with given name.
Parameters: - name – Name of the dialect to remove.
Throws: - MetaborgRuntimeException – When dialect with given name does not exist.
Returns: Removed dialect language.
remove¶
-
Iterable<ILanguageImpl>
remove
(ILanguageImpl base)¶ Removes all dialects based on given language. Does nothing if there are no dialects of that language.
Parameters: - base – Base language to remove all dialects for.
Returns: Removed dialect languages.
update¶
-
ILanguageImpl
update
(String name, IFacet parserFacet)¶ Updates dialect of given name, with a new parser facet.
Parameters: - name – Name of the dialect to update.
- parserFacet – Parser facet to update the dialect with.
Throws: - MetaborgRuntimeException – When dialect with given name does not exist.
Returns: Updated dialect language.
update¶
-
Iterable<ILanguageImpl>
update
(ILanguageImpl base)¶ Updates all dialects based on
base
. Does nothing if there were no dialects based onbase
.Parameters: - base – Base language for which to update dialects.
Returns: Updated dialect languages.