Module xl.compiler

Class CompilerBase

java.lang.Object
antlr.TreeParser
de.grogra.xl.compiler.CompilerBase
All Implemented Interfaces:
CompilerTokenTypes, Members.Resolution
Direct Known Subclasses:
Compiler

public abstract class CompilerBase extends antlr.TreeParser implements CompilerTokenTypes, Members.Resolution
This helper class is the superclass of Compiler. Its members would normally be declared in Compiler. However, since the latter class is generated by ANTLR from a grammar file, it is more convenient to extract these members to a helper class which is defined by this conventional Java source file.
Author:
Ole Kniemeyer
  • Field Details

  • Method Details

    • getRun

      public int getRun()
      Returns the current run of the compiler. The compiler works in three runs. The return value indicates the current run.
      Returns:
      current run
      See Also:
    • compile

      public Object compile(ClassPath classPath, Scope defaultImports, Parser parser, CClass shell) throws IOException, RecognitionException
      Throws:
      IOException
      RecognitionException
    • compile

      protected abstract CompilationUnitScope compile(CompilationUnit unit, CClass shell) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • compile

      public CompilationUnitScope[] compile(CompilationUnit[] units, CClass shell, BytecodeWriter writer, FileSystem fs, Object dir, boolean keepExpressions) throws IOException
      Throws:
      IOException
    • attachXL16UCallableSignature

      protected void attachXL16UCallableSignature(Member member)
    • attachXL16USymbolMetadata

      protected void attachXL16USymbolMetadata(Member member, String symbolName)
    • activateXL16ULegacyBackendConsumptionRoute

      protected void activateXL16ULegacyBackendConsumptionRoute(CompilationUnit unit)
    • getActiveXL16ULegacyBackendConsumptionPlan

      protected XL16USourceOwnedLegacyBackendConsumptionPlan getActiveXL16ULegacyBackendConsumptionPlan()
    • activeXL16ULegacyBackendRouteUsesAstOwnedConsumption

      protected boolean activeXL16ULegacyBackendRouteUsesAstOwnedConsumption()
    • getActiveXL16ULegacyBackendConsumedNodes

      protected List<XL16USourceOwnedLegacyBackendConsumptionResult.ConsumedBoundaryNode> getActiveXL16ULegacyBackendConsumedNodes()
    • getActiveXL16ULegacyBackendDeclarationConsumedNodes

      protected List<XL16USourceOwnedLegacyBackendConsumptionResult.ConsumedBoundaryNode> getActiveXL16ULegacyBackendDeclarationConsumedNodes()
    • getActiveXL16ULegacyBackendStatementConsumedNodes

      protected List<XL16USourceOwnedLegacyBackendConsumptionResult.ConsumedBoundaryNode> getActiveXL16ULegacyBackendStatementConsumedNodes()
    • getActiveXL16ULegacyBackendConsumedNodeCount

      protected int getActiveXL16ULegacyBackendConsumedNodeCount()
    • recordXL16ULegacyBackendGeneratedAction

      protected void recordXL16ULegacyBackendGeneratedAction(antlr.collections.AST actionAst)
    • getActiveXL16ULegacyBackendGeneratedActionAsts

      protected List<antlr.collections.AST> getActiveXL16ULegacyBackendGeneratedActionAsts()
    • getActiveXL16ULegacyBackendActionConsumptionResult

      protected XL16USourceOwnedLegacyBackendActionConsumptionResult getActiveXL16ULegacyBackendActionConsumptionResult()
    • getActiveXL16ULegacyBackendActionConsumedNodes

      protected List<XL16USourceOwnedLegacyBackendConsumptionResult.ConsumedBoundaryNode> getActiveXL16ULegacyBackendActionConsumedNodes()
    • getActiveXL16ULegacyBackendActionDeclarationConsumedNodes

      protected List<XL16USourceOwnedLegacyBackendConsumptionResult.ConsumedBoundaryNode> getActiveXL16ULegacyBackendActionDeclarationConsumedNodes()
    • getActiveXL16ULegacyBackendActionStatementConsumedNodes

      protected List<XL16USourceOwnedLegacyBackendConsumptionResult.ConsumedBoundaryNode> getActiveXL16ULegacyBackendActionStatementConsumedNodes()
    • getActiveXL16ULegacyBackendGeneratedActionAstCount

      protected int getActiveXL16ULegacyBackendGeneratedActionAstCount()
    • getActiveXL16ULegacyBackendActionConsumedNodeCount

      protected int getActiveXL16ULegacyBackendActionConsumedNodeCount()
    • getActiveXL16ULegacyBackendActionDeclarationConsumedNodeCount

      protected int getActiveXL16ULegacyBackendActionDeclarationConsumedNodeCount()
    • getActiveXL16ULegacyBackendActionStatementConsumedNodeCount

      protected int getActiveXL16ULegacyBackendActionStatementConsumedNodeCount()
    • activeXL16ULegacyBackendGeneratedActionsConsumedAllRouteNodes

      protected boolean activeXL16ULegacyBackendGeneratedActionsConsumedAllRouteNodes()
    • activeXL16ULegacyBackendGeneratedActionsReady

      protected boolean activeXL16ULegacyBackendGeneratedActionsReady()
    • activeXL16ULegacyBackendGeneratedActionsConsumedSelectedSemanticAstBytecodeCallSiteReplacement

      protected boolean activeXL16ULegacyBackendGeneratedActionsConsumedSelectedSemanticAstBytecodeCallSiteReplacement()
    • activeXL16ULegacyBackendGeneratedActionsRequireCompatibilitySourceFallback

      protected boolean activeXL16ULegacyBackendGeneratedActionsRequireCompatibilitySourceFallback()
    • getActiveXL16ULegacyBackendCodeGenerationResult

      protected XL16USourceOwnedLegacyBackendCodeGenerationStageResult getActiveXL16ULegacyBackendCodeGenerationResult()
    • getActiveXL16ULegacyBackendCodeGenerationAdaptedNodes

      protected List<XL16USourceOwnedLegacyBackendCodeGenerationStageResult.AdaptedNode> getActiveXL16ULegacyBackendCodeGenerationAdaptedNodes()
    • getActiveXL16ULegacyBackendCodeGenerationDeclarationAdaptedNodes

      protected List<XL16USourceOwnedLegacyBackendCodeGenerationStageResult.AdaptedNode> getActiveXL16ULegacyBackendCodeGenerationDeclarationAdaptedNodes()
    • getActiveXL16ULegacyBackendCodeGenerationStatementAdaptedNodes

      protected List<XL16USourceOwnedLegacyBackendCodeGenerationStageResult.AdaptedNode> getActiveXL16ULegacyBackendCodeGenerationStatementAdaptedNodes()
    • getActiveXL16ULegacyBackendCodeGenerationAdaptedNodeCount

      protected int getActiveXL16ULegacyBackendCodeGenerationAdaptedNodeCount()
    • activeXL16ULegacyBackendCodeGenerationReady

      protected boolean activeXL16ULegacyBackendCodeGenerationReady()
    • activeXL16ULegacyBackendCodeGenerationConsumedSelectedSemanticAstBytecodeCallSiteReplacement

      protected boolean activeXL16ULegacyBackendCodeGenerationConsumedSelectedSemanticAstBytecodeCallSiteReplacement()
    • activeXL16ULegacyBackendCodeGenerationRequiresCompatibilitySourceFallback

      protected boolean activeXL16ULegacyBackendCodeGenerationRequiresCompatibilitySourceFallback()
    • getActiveXL16ULegacyBackendCodeGenerationEmitterResult

      protected XL16USourceOwnedLegacyBackendCodeGenerationEmitterResult getActiveXL16ULegacyBackendCodeGenerationEmitterResult()
    • getActiveXL16ULegacyBackendCodeGenerationEmittedNodes

      protected List<XL16USourceOwnedLegacyBackendCodeGenerationEmitterResult.EmittedNode> getActiveXL16ULegacyBackendCodeGenerationEmittedNodes()
    • getActiveXL16ULegacyBackendCodeGenerationDeclarationEmittedNodes

      protected List<XL16USourceOwnedLegacyBackendCodeGenerationEmitterResult.EmittedNode> getActiveXL16ULegacyBackendCodeGenerationDeclarationEmittedNodes()
    • getActiveXL16ULegacyBackendCodeGenerationStatementEmittedNodes

      protected List<XL16USourceOwnedLegacyBackendCodeGenerationEmitterResult.EmittedNode> getActiveXL16ULegacyBackendCodeGenerationStatementEmittedNodes()
    • getActiveXL16ULegacyBackendCodeGenerationEmittedNodeCount

      protected int getActiveXL16ULegacyBackendCodeGenerationEmittedNodeCount()
    • activeXL16ULegacyBackendEmissionReady

      protected boolean activeXL16ULegacyBackendEmissionReady()
    • activeXL16ULegacyBackendEmissionConsumedSelectedSemanticAstBytecodeCallSiteReplacement

      protected boolean activeXL16ULegacyBackendEmissionConsumedSelectedSemanticAstBytecodeCallSiteReplacement()
    • activeXL16ULegacyBackendEmissionRequiresCompatibilitySourceFallback

      protected boolean activeXL16ULegacyBackendEmissionRequiresCompatibilitySourceFallback()
    • activeXL16ULegacyBackendRouteUsesCompatibilitySourceFallback

      protected boolean activeXL16ULegacyBackendRouteUsesCompatibilitySourceFallback()
    • getActiveXL16UBackendRuntimeAstOwnedBridgeCallSiteReplacementResult

      protected XL16UBackendRuntimeAstOwnedBridgeCallSiteReplacementResult getActiveXL16UBackendRuntimeAstOwnedBridgeCallSiteReplacementResult()
    • activeXL16UBackendRuntimeAstOwnedBridgeCallSiteReplacementReady

      protected boolean activeXL16UBackendRuntimeAstOwnedBridgeCallSiteReplacementReady()
    • activeXL16UBackendRuntimeAstOwnedBridgeCallSiteReplacementRequiresCompatibilitySourceFallback

      protected boolean activeXL16UBackendRuntimeAstOwnedBridgeCallSiteReplacementRequiresCompatibilitySourceFallback()
    • activeXL16USemanticAstBytecodeCallSiteReplacementReady

      protected boolean activeXL16USemanticAstBytecodeCallSiteReplacementReady()
    • activeXL16USemanticAstBytecodeCallSiteReplacementRequiresCompatibilitySourceFallback

      protected boolean activeXL16USemanticAstBytecodeCallSiteReplacementRequiresCompatibilitySourceFallback()
    • selectActiveXL16USemanticAstBytecodeCallSitePath

      protected XL16UBackendCallSitePath selectActiveXL16USemanticAstBytecodeCallSitePath()
    • getSelectedActiveXL16USemanticAstBytecodeCallSiteReplacement

      protected XL16UBackendRuntimeAstOwnedBridgeCallSiteReplacementResult.AstOwnedBridgeCallSiteReplacement getSelectedActiveXL16USemanticAstBytecodeCallSiteReplacement()
    • activeXL16USemanticEffectRuntimeCallSiteReplacementReady

      protected boolean activeXL16USemanticEffectRuntimeCallSiteReplacementReady()
    • activeXL16USemanticEffectRuntimeCallSiteReplacementRequiresCompatibilitySourceFallback

      protected boolean activeXL16USemanticEffectRuntimeCallSiteReplacementRequiresCompatibilitySourceFallback()
    • selectActiveXL16USemanticEffectRuntimeCallSitePath

      protected XL16UBackendCallSitePath selectActiveXL16USemanticEffectRuntimeCallSitePath()
    • getSelectedActiveXL16USemanticEffectRuntimeCallSiteReplacement

      protected XL16UBackendRuntimeAstOwnedBridgeCallSiteReplacementResult.AstOwnedBridgeCallSiteReplacement getSelectedActiveXL16USemanticEffectRuntimeCallSiteReplacement()
    • activeXL16UCommitTailRuntimeCallSiteReplacementReady

      protected boolean activeXL16UCommitTailRuntimeCallSiteReplacementReady()
    • activeXL16UCommitTailRuntimeCallSiteReplacementRequiresCompatibilitySourceFallback

      protected boolean activeXL16UCommitTailRuntimeCallSiteReplacementRequiresCompatibilitySourceFallback()
    • selectActiveXL16UCommitTailRuntimeCallSitePath

      protected XL16UBackendCallSitePath selectActiveXL16UCommitTailRuntimeCallSitePath()
    • getSelectedActiveXL16UCommitTailRuntimeCallSiteReplacement

      protected XL16UBackendRuntimeAstOwnedBridgeCallSiteReplacementResult.AstOwnedBridgeCallSiteReplacement getSelectedActiveXL16UCommitTailRuntimeCallSiteReplacement()
    • getXL16USourceOwnedLegacyCodeGenerationBoundaryResult

      protected XL16USourceOwnedLegacyCodeGenerationBoundaryResult getXL16USourceOwnedLegacyCodeGenerationBoundaryResult()
    • getXL16USourceOwnedLegacyBackendConsumptionResult

      protected XL16USourceOwnedLegacyBackendConsumptionResult getXL16USourceOwnedLegacyBackendConsumptionResult()
    • getXL16USourceOwnedLegacyBackendConsumptionPlan

      protected XL16USourceOwnedLegacyBackendConsumptionPlan getXL16USourceOwnedLegacyBackendConsumptionPlan()
    • getXL16USourceOwnedLegacyBackendConsumedNodes

      protected List<XL16USourceOwnedLegacyBackendConsumptionResult.ConsumedBoundaryNode> getXL16USourceOwnedLegacyBackendConsumedNodes()
    • consumedAllXL16USourceOwnedLegacyBackendBoundaryNodes

      protected boolean consumedAllXL16USourceOwnedLegacyBackendBoundaryNodes()
    • xl16uSourceOwnedLegacyBackendConsumptionReady

      protected boolean xl16uSourceOwnedLegacyBackendConsumptionReady()
    • xl16uUsesAstOwnedLegacyBackendConsumption

      protected boolean xl16uUsesAstOwnedLegacyBackendConsumption()
    • xl16uUsesCompatibilitySourceFallbackForLegacyBackend

      protected boolean xl16uUsesCompatibilitySourceFallbackForLegacyBackend()
    • getXL16USourceOwnedLegacyCodeGenerationBoundaryNodes

      protected List<XL16USourceOwnedLegacyCodeGenerationBoundaryResult.BoundaryNode> getXL16USourceOwnedLegacyCodeGenerationBoundaryNodes()
    • getXL16USourceOwnedLegacyCodeGenerationDeclarationBoundaryNodes

      protected List<XL16USourceOwnedLegacyCodeGenerationBoundaryResult.BoundaryNode> getXL16USourceOwnedLegacyCodeGenerationDeclarationBoundaryNodes()
    • getXL16USourceOwnedLegacyCodeGenerationStatementBoundaryNodes

      protected List<XL16USourceOwnedLegacyCodeGenerationBoundaryResult.BoundaryNode> getXL16USourceOwnedLegacyCodeGenerationStatementBoundaryNodes()
    • hasXL16USourceOwnedLegacyCodeGenerationBoundaryWork

      protected boolean hasXL16USourceOwnedLegacyCodeGenerationBoundaryWork()
    • xl16uSourceOwnedLegacyCodeGenerationBoundaryReady

      protected boolean xl16uSourceOwnedLegacyCodeGenerationBoundaryReady()
    • xl16uSourceOwnedLegacyCodeGenerationRequiresCompatibilitySourceFallback

      protected boolean xl16uSourceOwnedLegacyCodeGenerationRequiresCompatibilitySourceFallback()
    • getXL16UBackendRuntimeAstOwnedBridgeCallSiteReplacementResult

      protected XL16UBackendRuntimeAstOwnedBridgeCallSiteReplacementResult getXL16UBackendRuntimeAstOwnedBridgeCallSiteReplacementResult()
    • xl16uBackendRuntimeAstOwnedBridgeCallSiteReplacementReady

      protected boolean xl16uBackendRuntimeAstOwnedBridgeCallSiteReplacementReady()
    • xl16uBackendRuntimeAstOwnedBridgeCallSiteReplacementRequiresCompatibilitySourceFallback

      protected boolean xl16uBackendRuntimeAstOwnedBridgeCallSiteReplacementRequiresCompatibilitySourceFallback()
    • xl16uSemanticAstBytecodeCallSiteReplacementReady

      protected boolean xl16uSemanticAstBytecodeCallSiteReplacementReady()
    • xl16uSemanticAstBytecodeCallSiteReplacementRequiresCompatibilitySourceFallback

      protected boolean xl16uSemanticAstBytecodeCallSiteReplacementRequiresCompatibilitySourceFallback()
    • selectXL16USemanticAstBytecodeCallSitePath

      protected XL16UBackendCallSitePath selectXL16USemanticAstBytecodeCallSitePath()
    • getSelectedXL16USemanticAstBytecodeCallSiteReplacement

      protected XL16UBackendRuntimeAstOwnedBridgeCallSiteReplacementResult.AstOwnedBridgeCallSiteReplacement getSelectedXL16USemanticAstBytecodeCallSiteReplacement()
    • xl16uSemanticEffectRuntimeCallSiteReplacementReady

      protected boolean xl16uSemanticEffectRuntimeCallSiteReplacementReady()
    • xl16uSemanticEffectRuntimeCallSiteReplacementRequiresCompatibilitySourceFallback

      protected boolean xl16uSemanticEffectRuntimeCallSiteReplacementRequiresCompatibilitySourceFallback()
    • selectXL16USemanticEffectRuntimeCallSitePath

      protected XL16UBackendCallSitePath selectXL16USemanticEffectRuntimeCallSitePath()
    • getSelectedXL16USemanticEffectRuntimeCallSiteReplacement

      protected XL16UBackendRuntimeAstOwnedBridgeCallSiteReplacementResult.AstOwnedBridgeCallSiteReplacement getSelectedXL16USemanticEffectRuntimeCallSiteReplacement()
    • xl16uCommitTailRuntimeCallSiteReplacementReady

      protected boolean xl16uCommitTailRuntimeCallSiteReplacementReady()
    • xl16uCommitTailRuntimeCallSiteReplacementRequiresCompatibilitySourceFallback

      protected boolean xl16uCommitTailRuntimeCallSiteReplacementRequiresCompatibilitySourceFallback()
    • selectXL16UCommitTailRuntimeCallSitePath

      protected XL16UBackendCallSitePath selectXL16UCommitTailRuntimeCallSitePath()
    • getSelectedXL16UCommitTailRuntimeCallSiteReplacement

      protected XL16UBackendRuntimeAstOwnedBridgeCallSiteReplacementResult.AstOwnedBridgeCallSiteReplacement getSelectedXL16UCommitTailRuntimeCallSiteReplacement()
    • supportsVersion

      public boolean supportsVersion(int ver)
      Returns true if the specified version number designates a version of the JVM that is compatible with the target version currently set. Valid values for the version number are the constants in org.objectweb.asm.Opcodes.V* For instance a call supportsVersion(Opcodes.V1_4) with Opcodes.V1_4 currently set as target would return true. The same call with Opcodes.V1_3 set as target would return false.
      Parameters:
      ver -
      Returns:
    • getPackage

      public Package getPackage()
      Returns the package of the current compilation unit.
      Returns:
      current package
    • getCompilationUnitScope

      public CompilationUnitScope getCompilationUnitScope()
      Return the current value of the CompilationUnitScope.
      Returns:
      current CompilationUnitScope
    • getXL16UFrontendRoute

      protected XL16UFrontendRouteGate.Route getXL16UFrontendRoute()
    • getXL16UFrontendRouteId

      protected String getXL16UFrontendRouteId()
    • usesXL16UHandBuiltFrontendRoute

      protected boolean usesXL16UHandBuiltFrontendRoute()
    • usesXL16UExperimentalAntlrFrontendRoute

      protected boolean usesXL16UExperimentalAntlrFrontendRoute()
    • getXL16UFrontendParseSummary

      protected XL16UFrontendParseSummary getXL16UFrontendParseSummary()
    • getXL16UAggregateQueryFallbackGate

      protected XL16UAggregateQueryFallbackGate getXL16UAggregateQueryFallbackGate()
    • getXL16UDirectAggregateEmitterPlan

      protected XL16UDirectAggregateEmitterPlan getXL16UDirectAggregateEmitterPlan()
    • getXL16UDirectAggregateInvocationPlan

      protected XL16UDirectAggregateInvocationPlan getXL16UDirectAggregateInvocationPlan()
    • matchActiveXL16UDirectAggregateInvocation

      protected XL16UDirectAggregateInvocationPlan.Invocation matchActiveXL16UDirectAggregateInvocation(String aggregateName)
    • compileXL16UDirectAggregateInvocation

      protected Expression compileXL16UDirectAggregateInvocation(String aggregateName, CompiletimeModel model, BlockScope scope, antlr.collections.AST position)
    • xl16uParsedBySelectedFrontend

      protected boolean xl16uParsedBySelectedFrontend()
    • getXL16UFrontendParseTokenCount

      protected int getXL16UFrontendParseTokenCount()
    • getXL16UFrontendParseDeclarationCount

      protected int getXL16UFrontendParseDeclarationCount()
    • getXL16UFrontendParseCallableCount

      protected int getXL16UFrontendParseCallableCount()
    • getTypeScope

      public TypeScope getTypeScope()
      Return the current value of the TypeScope.
      Returns:
      current TypeScope
    • modifiersToString

      public static final String modifiersToString(long mods)
    • copyInfo

      public static void copyInfo(Expression src, Expression dest)
    • setBlockScope

      public static void setBlockScope(Expression e, BlockScope s)
    • getBlockScope

      public static BlockScope getBlockScope(Expression e)
    • setAST

      public static Expression setAST(Expression e, antlr.collections.AST ast)
    • getAST

      public static antlr.collections.AST getAST(Expression e)
    • setLegalSupertype

      public void setLegalSupertype(Type lst)
    • setVerbose

      public void setVerbose(PrintWriter out)
    • verifyNotDeclared

      public String verifyNotDeclared(antlr.collections.AST name, BlockScope s)
    • verifyNotDeclared

      public String verifyNotDeclared(String name, BlockScope s, antlr.collections.AST pos)
    • intersect

      public void intersect(IntersectionType intersection, Type newType, antlr.collections.AST pos)
    • getWrapperTypeFor

      public Type getWrapperTypeFor(Type type, CompiletimeModel model, antlr.collections.AST pos)
    • castingConversion

      public Expression castingConversion(Expression expr, Type type, Scope scope, antlr.collections.AST pos)
    • wideningConversion

      public Expression wideningConversion(Expression expr, Type type, Scope scope, antlr.collections.AST pos)
    • methodInvocationConversion

      public Expression methodInvocationConversion(Expression expr, Type type, Scope scope, antlr.collections.AST pos)
    • assignmentConversion

      public Expression assignmentConversion(Expression expr, Type type, Scope scope, antlr.collections.AST pos)
    • returnConversion

      public Expression returnConversion(Expression expr, Type type, Scope scope, antlr.collections.AST pos)
    • typeForType

      public Type typeForType(Type type)
    • getAnnotation

      public <T extends Annotation> Annotation<T> getAnnotation(Member member, Class<T> cls, boolean inherited)
    • implicitConversion

      public Expression implicitConversion(Expression expr, Type type, boolean allowD2F, Scope scope, antlr.collections.AST pos, String msg, boolean test)
      Perform autoconversion of the expression to target type. Autoconversion includes widening conversions, boxing and unboxing, and allows to transform an object of type A into an object of type B by means of conversion functions. Every function declared as 'static B valueOf(A)', 'static B toB(A)', 'B A.toB()' and constructors of the form 'B(A)' are considered as conversion functions. If more than one conversion from type A to type B using those conversion functions is possible, the conversion is ambiguous and results in an error.
      Parameters:
      expr - source expression
      type - target type
      scope - current scope
      pos - location to use for error reports
      msg - message key to use for error reports
      boxOnly - only check for autoboxing/unboxing, no further autoconversions
      Returns:
      auto-converted expression, or null if no such conversion is possible and msg is null
    • castingConversion

      public Expression castingConversion(Expression expr, Type type, Scope scope, antlr.collections.AST pos, String msg, boolean test)
    • standardImplicitConversion

      public Expression standardImplicitConversion(Expression expr, Type type, boolean allowD2F, Scope scope, antlr.collections.AST pos, String msg, boolean test)
      Perform autoconversion of the expression to target type. Autoconversion includes widening conversions, boxing and unboxing, and allows to transform an object of type A into an object of type B by means of conversion functions. Every function declared as 'static B valueOf(A)', 'static B toB(A)', 'B A.toB()' and constructors of the form 'B(A)' are considered as conversion functions. If more than one conversion from type A to type B using those conversion functions is possible, the conversion is ambiguous and results in an error.
      Parameters:
      expr - source expression
      type - target type
      scope - current scope
      pos - location to use for error reports
      msg - message key to use for error reports
      boxOnly - only check for autoboxing/unboxing, no further autoconversions
      Returns:
      auto-converted expression, or null if no such conversion is possible and msg is null
    • createModel

      public <T> T createModel(Class<T> type, Type<?> model, antlr.collections.AST pos)
    • allowsAmbiguousMembers

      public boolean allowsAmbiguousMembers(Member first)
      Description copied from interface: Members.Resolution
      Defines if ambiguous members are allowed. If so, ambiguities between members do not cause an exception be thrown in
      invalid reference
      Members#find(Resolution)
      ; the first member is returned.
      Specified by:
      allowsAmbiguousMembers in interface Members.Resolution
      Parameters:
      first - the first member of a set of ambiguous members
      Returns:
      true iff ambiguous members are allowed and first shall be returned as the result of resolution
    • isApplicable

      public boolean isApplicable(Member m, Members.Applicability appl, Scope scope)
      Description copied from interface: Members.Resolution
      Checks whether a member m is applicable. The quality of applicability is stored in applOut by this method.
      Specified by:
      isApplicable in interface Members.Resolution
      Parameters:
      m - a member
      appl - the quality of applicability is stored here by this method
      scope - scope in which the member is accessed
      Returns:
      true iff m is applicable
    • getArgumentTypes

      public Type[] getArgumentTypes()
      Description copied from interface: Members.Resolution
      Returns the argument types which are used in Members.Resolution.isApplicable(Member, Members.Applicability, Scope) to determine the applicability. This method is only invoked to generate an error message in case no applicable member was found.
      Specified by:
      getArgumentTypes in interface Members.Resolution
      Returns:
      argument types
    • isLessThan

      public boolean isLessThan(Member m1, Members.Applicability a1, Member m2, Members.Applicability a2, Scope scope)
      Description copied from interface: Members.Resolution
      Checks whether an applicable member m1 is less specific than another applicable member m2. The applicablities are the same instances which have been passed before to Members.Resolution.isApplicable(Member, Members.Applicability, Scope).
      Specified by:
      isLessThan in interface Members.Resolution
      Parameters:
      m1 - a member
      a1 - m1's applicability as determined by Members.Resolution.isApplicable(Member, Members.Applicability, Scope)
      m2 - another member
      a2 - m2's applicability as determined by Members.Resolution.isApplicable(Member, Members.Applicability, Scope)
      scope - scope in which the member is accessed
      Returns:
      true iff m1 is less specific than m2
    • compileFieldExpression

      public Expression compileFieldExpression(Field field, Expression expr, Scope scope, antlr.collections.AST pos)
    • compileInstance

      public Expression compileInstance(Member m, Scope declaring, Scope s, antlr.collections.AST pos)
    • finish

      public void finish(TypeScope scope, antlr.collections.AST pos)
    • checkOperatorFunction

      public static void checkOperatorFunction(antlr.collections.AST params, antlr.collections.AST mods, antlr.collections.AST id, int symbol, RecognitionExceptionList exceptionList)
    • getDefaultPackageName

      public String getDefaultPackageName()
      Return the package name to use as default. The default package (in java) is "". That package is available from all other classes in the default package. For .rgg files to be available without package name (i.e. import Model.*) they need to be in the default java package. But for exporting the project as usable library, it easier if these classes get added to a defined package.
    • getParameterManagerTypeFromName

      public Type<? extends ParameterManager> getParameterManagerTypeFromName(String name, antlr.collections.AST pos)
    • addParameterManager

      public void addParameterManager(Type<? extends ParameterManager> m, String name, antlr.collections.AST pos)
      Only parameterManager with names are added to the list. Nameless ParameterManager cannot be called. Either: - the PM is called DEFAULT -> replace if exists. - the PM is called EMPTY -> add if not exists - the PM is already in the list -> exit. - the PM is not in the list and no other PM have the same name -> add it. - the PM is not is the list but another PM have the same name -> error invalid input: '&' dont add
    • getParameterManagerTypeFromAnnotation

      public Type<? extends ParameterManager> getParameterManagerTypeFromAnnotation(Annotation a)
    • declareParameterManager

      public void declareParameterManager(de.grogra.xl.compiler.AnnotationInfo annot, antlr.collections.AST pos)
      Add a new parameter manager to the list. The list is shared between all Compile Unit
    • setDefaultParameterManager

      public void setDefaultParameterManager(de.grogra.xl.compiler.AnnotationInfo annot, antlr.collections.AST pos)
      Define the declared parameter manager as default to the current type. (declare the annotation to the type)
    • checkAnnotationType

      public void checkAnnotationType(de.grogra.xl.compiler.AnnotationInfo annot, antlr.collections.AST pos, long allowed)
      Check if the annotation respect its Target based on the flag.
    • annotationToRunBeforeCompilation

      public boolean annotationToRunBeforeCompilation(de.grogra.xl.compiler.AnnotationInfo annot)
      return true if the annotation is of a special type and need to be processed before the COMPILATION step. Such type of annotation are not added to any type, and they can be duplicated
    • processBeforeCompilationAnnotation

      public void processBeforeCompilationAnnotation(de.grogra.xl.compiler.AnnotationInfo annot, antlr.collections.AST pos)
    • processAdditionalAnnotation

      public void processAdditionalAnnotation(de.grogra.xl.compiler.AnnotationInfo annot, antlr.collections.AST pos)
      Method that process any implementation of read by the compiler. Just so next time I want to process some additional annotations I do not have to modify and regenerate the Compiler.g.
    • getDefaultInitialization

      public Expression getDefaultInitialization(Expression e)
      Get the default object for variable initialization. XL enables to call variable without initializing them. In order to no make the compiler throw an Verrify error, the variable should be init. The default values are: numeric = 0; boolean = false, object = null;