Class MCCommonLiteralsMill

java.lang.Object
de.monticore.literals.mccommonliterals.MCCommonLiteralsMill
Direct Known Subclasses:
MCCommonLiteralsMillForCardinality, MCCommonLiteralsMillForDETemporals, MCCommonLiteralsMillForEscapedTemporalLiterals, MCCommonLiteralsMillForGrammar, MCCommonLiteralsMillForGrammar_WithConcepts, MCCommonLiteralsMillForISOTemporals, MCCommonLiteralsMillForJavaLight, MCCommonLiteralsMillForMCCommon, MCCommonLiteralsMillForMCJavaLiterals, MCCommonLiteralsMillForODRules, MCCommonLiteralsMillForRegExType, MCCommonLiteralsMillForRegularExpressions, MCCommonLiteralsMillForSIUnitLiterals, MCCommonLiteralsMillForSIUnits, MCCommonLiteralsMillForSIUnitTypes4Computing, MCCommonLiteralsMillForSIUnitTypes4Math, MCCommonLiteralsMillForTags, MCCommonLiteralsMillForTagSchema, MCCommonLiteralsMillForTemporalBasis, MCCommonLiteralsMillForTFBasisExts, MCCommonLiteralsMillForTFCommons, MCCommonLiteralsMillForUMLModifier, MCCommonLiteralsMillForUMLStereotype

public class MCCommonLiteralsMill extends Object
The 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 Details

  • Constructor Details

    • MCCommonLiteralsMill

      protected MCCommonLiteralsMill()
  • Method Details

    • getMill

      public static MCCommonLiteralsMill 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.
    • nullLiteralBuilder

      public static ASTNullLiteralBuilder nullLiteralBuilder()
    • _nullLiteralBuilder

      protected ASTNullLiteralBuilder _nullLiteralBuilder()
    • booleanLiteralBuilder

      public static ASTBooleanLiteralBuilder booleanLiteralBuilder()
    • _booleanLiteralBuilder

      protected ASTBooleanLiteralBuilder _booleanLiteralBuilder()
    • charLiteralBuilder

      public static ASTCharLiteralBuilder charLiteralBuilder()
    • _charLiteralBuilder

      protected ASTCharLiteralBuilder _charLiteralBuilder()
    • stringLiteralBuilder

      public static ASTStringLiteralBuilder stringLiteralBuilder()
    • _stringLiteralBuilder

      protected ASTStringLiteralBuilder _stringLiteralBuilder()
    • natLiteralBuilder

      public static ASTNatLiteralBuilder natLiteralBuilder()
    • _natLiteralBuilder

      protected ASTNatLiteralBuilder _natLiteralBuilder()
    • signedNatLiteralBuilder

      public static ASTSignedNatLiteralBuilder signedNatLiteralBuilder()
    • _signedNatLiteralBuilder

      protected ASTSignedNatLiteralBuilder _signedNatLiteralBuilder()
    • basicLongLiteralBuilder

      public static ASTBasicLongLiteralBuilder basicLongLiteralBuilder()
    • _basicLongLiteralBuilder

      protected ASTBasicLongLiteralBuilder _basicLongLiteralBuilder()
    • signedBasicLongLiteralBuilder

      public static ASTSignedBasicLongLiteralBuilder signedBasicLongLiteralBuilder()
    • _signedBasicLongLiteralBuilder

      protected ASTSignedBasicLongLiteralBuilder _signedBasicLongLiteralBuilder()
    • basicFloatLiteralBuilder

      public static ASTBasicFloatLiteralBuilder basicFloatLiteralBuilder()
    • _basicFloatLiteralBuilder

      protected ASTBasicFloatLiteralBuilder _basicFloatLiteralBuilder()
    • signedBasicFloatLiteralBuilder

      public static ASTSignedBasicFloatLiteralBuilder signedBasicFloatLiteralBuilder()
    • _signedBasicFloatLiteralBuilder

      protected ASTSignedBasicFloatLiteralBuilder _signedBasicFloatLiteralBuilder()
    • basicDoubleLiteralBuilder

      public static ASTBasicDoubleLiteralBuilder basicDoubleLiteralBuilder()
    • _basicDoubleLiteralBuilder

      protected ASTBasicDoubleLiteralBuilder _basicDoubleLiteralBuilder()
    • signedBasicDoubleLiteralBuilder

      public static ASTSignedBasicDoubleLiteralBuilder signedBasicDoubleLiteralBuilder()
    • _signedBasicDoubleLiteralBuilder

      protected ASTSignedBasicDoubleLiteralBuilder _signedBasicDoubleLiteralBuilder()
    • prettyPrint

      public static 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 printed
      printComments - Whether comments should be printed
      Returns:
      The pretty printer output
    • _prettyPrint

      protected String _prettyPrint(de.monticore.ast.ASTNode node, boolean printComments)
    • typeDispatcher

      @Deprecated(forRemoval=true) public static IMCCommonLiteralsTypeDispatcher typeDispatcher()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • _typeDispatcher

      @Deprecated(forRemoval=true) protected IMCCommonLiteralsTypeDispatcher _typeDispatcher()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • traverser

      public static MCCommonLiteralsTraverser 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 requiring ITraverser.clearTraversedElements() to be called in case of re-use inheritanceTraverser() should be preferred over normal traverser, as they further enable language composition.
      Returns:
      a new instance of this language's traverser
    • _traverser

      protected MCCommonLiteralsTraverser _traverser()
    • inheritanceTraverser

      public static MCCommonLiteralsTraverser 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 requiring ITraverser.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 MCCommonLiteralsTraverser _inheritanceTraverser()
    • singleStepTraverser

      public static MCCommonLiteralsTraverser singleStepTraverser()
      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 requiring ITraverser.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
    • _singleStepTraverser

      protected MCCommonLiteralsTraverser _singleStepTraverser()
    • globalScope

      public static IMCCommonLiteralsGlobalScope globalScope()
    • _globalScope

      protected IMCCommonLiteralsGlobalScope _globalScope()
    • artifactScope

      public static IMCCommonLiteralsArtifactScope artifactScope()
    • _artifactScope

      protected IMCCommonLiteralsArtifactScope _artifactScope()
    • scope

      public static IMCCommonLiteralsScope scope()
    • _scope

      protected IMCCommonLiteralsScope _scope()
    • scopesGenitor

      public static MCCommonLiteralsScopesGenitor 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 for scopesGenitorDelegator().
      Returns:
      a new instance of this language's scope genitor
    • _scopesGenitor

      protected MCCommonLiteralsScopesGenitor _scopesGenitor()
    • scopesGenitorDelegator

      public static MCCommonLiteralsScopesGenitorDelegator 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 MCCommonLiteralsScopesGenitorDelegator _scopesGenitorDelegator()
    • initMe

      public static void initMe(MCCommonLiteralsMill a)
    • reset

      public static void reset()
    • getState

      public static MCCommonLiteralsMillState getState()
      EXPERIMENTAL! Returns the mill as an attribute (without static references required).
      Returns:
      the mill state
    • setState

      public static void setState(MCCommonLiteralsMillState state)
      EXPERIMENTAL! Loads the mill state into the static state.
      Parameters:
      state - The non-static state, see #getState()