Package de.monticore.types.mcbasictypes
Class MCBasicTypesMill
- java.lang.Object
-
- de.monticore.types.mcbasictypes.MCBasicTypesMill
-
- Direct Known Subclasses:
MCBasicTypesMillForGrammar,MCBasicTypesMillForGrammar_WithConcepts,MCBasicTypesMillForJavaClassExpressions,MCBasicTypesMillForJavaLight,MCBasicTypesMillForLambdaExpressions,MCBasicTypesMillForMCArrayStatements,MCBasicTypesMillForMCArrayTypes,MCBasicTypesMillForMCCollectionTypes,MCBasicTypesMillForMCCommonStatements,MCBasicTypesMillForMCExceptionStatements,MCBasicTypesMillForMCFullGenericTypes,MCBasicTypesMillForMCFullJavaStatements,MCBasicTypesMillForMCFunctionTypes,MCBasicTypesMillForMCSimpleGenericTypes,MCBasicTypesMillForMCStructuralTypes,MCBasicTypesMillForMCSynchronizedStatements,MCBasicTypesMillForMCVarDeclarationStatements,MCBasicTypesMillForOCLExpressions,MCBasicTypesMillForODRuleGeneration,MCBasicTypesMillForODRules,MCBasicTypesMillForRegExType,MCBasicTypesMillForSetExpressions,MCBasicTypesMillForSIUnitTypes4Computing,MCBasicTypesMillForSIUnitTypes4Math,MCBasicTypesMillForStreamExpressions,MCBasicTypesMillForTags,MCBasicTypesMillForTagSchema,MCBasicTypesMillForTFBasisExts,MCBasicTypesMillForTFCommons,MCBasicTypesMillForTypeParameters,MCBasicTypesMillForUglyExpressions
public class MCBasicTypesMill extends java.lang.ObjectThe mill is a factory for builders and other commonly used functions, such as parsers or visitors. The mill was introduced to ensure compositionality of languages, while retaining reusability of functions developed for sublanguages. Only one mill instance exists, even though in composed languages it is available under several static signatures.
-
-
Field Summary
Fields Modifier and Type Field Description protected MCBasicTypesFullPrettyPrinterfullPrettyPrinterprotected IMCBasicTypesGlobalScopemCBasicTypesGlobalScopeprotected static MCBasicTypesMillmillprotected IMCBasicTypesTypeDispatchertypeDispatcher
-
Constructor Summary
Constructors Modifier Constructor Description protectedMCBasicTypesMill()
-
Method Summary
-
-
-
Field Detail
-
mill
protected static MCBasicTypesMill mill
-
fullPrettyPrinter
protected MCBasicTypesFullPrettyPrinter fullPrettyPrinter
-
typeDispatcher
protected IMCBasicTypesTypeDispatcher typeDispatcher
-
mCBasicTypesGlobalScope
protected IMCBasicTypesGlobalScope mCBasicTypesGlobalScope
-
-
Method Detail
-
getMill
public static MCBasicTypesMill getMill()
-
init
public static void init()
Initializes a languages Mill. This will also initialize the Mills of all languages it depends on. This ensures that all objects of this mill, such as builders, traversers, scopes, ..., deliver the element of the correct language.
-
mCQualifiedNameBuilder
public static ASTMCQualifiedNameBuilder mCQualifiedNameBuilder()
-
_mCQualifiedNameBuilder
protected ASTMCQualifiedNameBuilder _mCQualifiedNameBuilder()
-
mCPackageDeclarationBuilder
public static ASTMCPackageDeclarationBuilder mCPackageDeclarationBuilder()
-
_mCPackageDeclarationBuilder
protected ASTMCPackageDeclarationBuilder _mCPackageDeclarationBuilder()
-
mCImportStatementBuilder
public static ASTMCImportStatementBuilder mCImportStatementBuilder()
-
_mCImportStatementBuilder
protected ASTMCImportStatementBuilder _mCImportStatementBuilder()
-
mCPrimitiveTypeBuilder
public static ASTMCPrimitiveTypeBuilder mCPrimitiveTypeBuilder()
-
_mCPrimitiveTypeBuilder
protected ASTMCPrimitiveTypeBuilder _mCPrimitiveTypeBuilder()
-
mCQualifiedTypeBuilder
public static ASTMCQualifiedTypeBuilder mCQualifiedTypeBuilder()
-
_mCQualifiedTypeBuilder
protected ASTMCQualifiedTypeBuilder _mCQualifiedTypeBuilder()
-
mCReturnTypeBuilder
public static ASTMCReturnTypeBuilder mCReturnTypeBuilder()
-
_mCReturnTypeBuilder
protected ASTMCReturnTypeBuilder _mCReturnTypeBuilder()
-
mCVoidTypeBuilder
public static ASTMCVoidTypeBuilder mCVoidTypeBuilder()
-
_mCVoidTypeBuilder
protected ASTMCVoidTypeBuilder _mCVoidTypeBuilder()
-
prettyPrint
public static java.lang.String prettyPrint(de.monticore.ast.ASTNode node, boolean printComments)Uses the composed pretty printer to print an ASTNode of this language- Parameters:
node- The ASTNode to be printedprintComments- Whether comments should be printed- Returns:
- The pretty printer output
-
_prettyPrint
protected java.lang.String _prettyPrint(de.monticore.ast.ASTNode node, boolean printComments)
-
typeDispatcher
public static IMCBasicTypesTypeDispatcher typeDispatcher()
-
_typeDispatcher
protected IMCBasicTypesTypeDispatcher _typeDispatcher()
-
traverser
public static MCBasicTypesTraverser traverser()
A traverser is the conceptual entry point for every action within the visitor infrastructure. Visitors may be added, which contain the implementations for the visit and endVisit methods. Handlers may be added to modify the default traversal strategy. Each traverser retains their traversed elements to avoid duplicate traversal, possibly requiringITraverser.clearTraversedElements()to be called in case of re-useinheritanceTraverser()should be preferred over normal traverser, as they further enable language composition.- Returns:
- a new instance of this language's traverser
-
_traverser
protected MCBasicTypesTraverser _traverser()
-
inheritanceTraverser
public static MCBasicTypesTraverser inheritanceTraverser()
A traverser is the conceptual entry point for every action within the visitor infrastructure. Visitors may be added, which contain the implementations for the visit and endVisit methods. Handlers may be added to modify the default traversal strategy. Each traverser retains their traversed elements to avoid duplicate traversal, possibly requiringITraverser.clearTraversedElements()to be called in case of re-use Inheritance Traverser should be preferred over default ones, as they further enable language composition.- Returns:
- a new instance of this language's inheritance traverser
-
_inheritanceTraverser
protected MCBasicTypesTraverser _inheritanceTraverser()
-
globalScope
public static IMCBasicTypesGlobalScope globalScope()
-
_globalScope
protected IMCBasicTypesGlobalScope _globalScope()
-
artifactScope
public static IMCBasicTypesArtifactScope artifactScope()
-
_artifactScope
protected IMCBasicTypesArtifactScope _artifactScope()
-
scope
public static IMCBasicTypesScope scope()
-
_scope
protected IMCBasicTypesScope _scope()
-
scopesGenitor
public static MCBasicTypesScopesGenitor scopesGenitor()
Returns a new ScopeGenitor. ScopeGenitors are responsible for creating the scope structure of artifacts of only this language and linking it with the AST nodes. Note: ScopeGenitors do NOT delegate to elements of composed languages which is why you are most likely looking forscopesGenitorDelegator().- Returns:
- a new instance of this language's scope genitor
-
_scopesGenitor
protected MCBasicTypesScopesGenitor _scopesGenitor()
-
scopesGenitorDelegator
public static MCBasicTypesScopesGenitorDelegator scopesGenitorDelegator()
Returns a new ScopeGenitorDelegator. Delegates to the ScopeGenitors of composed languages, used for instantiating symbol tables in the context of language composition See the delegators #createFromAST method.- Returns:
- a new instance of this language's scope genitor delegator
-
_scopesGenitorDelegator
protected MCBasicTypesScopesGenitorDelegator _scopesGenitorDelegator()
-
initMe
public static void initMe(MCBasicTypesMill a)
-
reset
public static void reset()
-
-