public OperandStackUnderflowProblem(IFlowgraph cfg, IBasicBlock b, int instructionIndex) { super(computeSourceLocationForBlockAndInstruction(cfg, b, instructionIndex)); } }
public ScopeStackUnderflowProblem(IFlowgraph cfg, IBasicBlock b, int instructionIndex) { super(computeSourceLocationForBlockAndInstruction(cfg, b, instructionIndex)); } }
@Override public boolean apply(ICompilerProblem problem) { return problem.getLine() == line; } };
@Override public boolean accept(ICompilerProblem problem) { if ( problem.getLine() != lineNumber || compareStrings(this.fileName, problem.getSourcePath()) != 0 ) { this.lineNumber = problem.getLine(); this.fileName = problem.getSourcePath(); } else if ( parserProblemOnLine && (problem instanceof AbstractSemanticProblem || problem instanceof CodegenProblem) ) { // Skip this problem. return false; } this.parserProblemOnLine = problem instanceof IParserProblem; return true; }
/** * verify a modifier used in global scope - issues errors that are common for all different decls * at this scope. * @param site location to use if a problem is reported * @param modifier the modifier to check */ protected void verifyModifier(IASNode site, ASModifier modifier) { if( modifier == ASModifier.STATIC ) currentScope.addProblem(new StaticOutsideClassProblem(site)); else if( modifier == ASModifier.FINAL ) currentScope.addProblem(new FinalOutsideClassProblem(site)); else if( modifier == ASModifier.OVERRIDE ) currentScope.addProblem(new OverrideOutsideClassProblem(site)); else if( modifier == ASModifier.VIRTUAL ) currentScope.addProblem(new VirtualOutsideClassProblem(site)); }
/** * Translate a ClassNode AST into ABC. * Subclasses should override this if * they can process class definitions. * @param c - the class' AST. */ void declareClass(ClassNode c) { problems.add(new BURMDiagnosticNotAllowedHereProblem(c)); }
/** * @param sourcePath Name of source file for which code was being * generated when this problem was found. Must not be null. * @param throwable {@link Throwable} that caused this problem to be created. must not be null. * @param subSystemName is the Compiler module where the problem occurred. For example "ABC generator". Must not be null * * Note that if you do not have the required ctor arguments, you might use InternalCompilerProblem * instead of this class */ public InternalCompilerProblem2(String sourcePath, Throwable throwable, String subSystemName) { super(sourcePath); this.sourcePath = sourcePath; this.subSystemName = subSystemName; this.stackTrace = makeStackTrace(throwable); }
@Override protected String[] processIncludeInOrExcludeFromAttribute(MXMLTreeBuilder builder, IMXMLTagAttributeData attribute) { // TODO Report the correct problem. ICompilerProblem problem = new MXMLSemanticProblem(attribute); builder.addProblem(problem); return null; }
/** * Check if class definition is allowed. * * @param keywordClass {@code class} keyword token. */ protected final void enterClassDefinition(final ASToken keywordClass) { if (!isGlobalContext()) addProblem(new NestedClassProblem(keywordClass)); }
/** * Check if interface definition is allowed. * * @param keywordInterface {@code interface} keyword token. */ protected final void enterInterfaceDefinition(final ASToken keywordInterface) { if (!isGlobalContext()) addProblem(new NestedInterfaceProblem(keywordInterface)); }
@Override public boolean accept(ICompilerProblem problem) { if ( problem.getLine() != lineNumber || compareStrings(this.fileName, problem.getSourcePath()) != 0 ) { this.lineNumber = problem.getLine(); this.fileName = problem.getSourcePath(); } else if ( parserProblemOnLine && (problem instanceof AbstractSemanticProblem || problem instanceof CodegenProblem) ) { // Skip this problem. return false; } this.parserProblemOnLine = problem instanceof IParserProblem; return true; }
/** * verify a modifier used in global scope - issues errors that are common for all different decls * at this scope. * @param site location to use if a problem is reported * @param modifier the modifier to check */ protected void verifyModifier(IASNode site, ASModifier modifier) { if( modifier == ASModifier.STATIC ) currentScope.addProblem(new StaticOutsideClassProblem(site)); else if( modifier == ASModifier.FINAL ) currentScope.addProblem(new FinalOutsideClassProblem(site)); else if( modifier == ASModifier.OVERRIDE ) currentScope.addProblem(new OverrideOutsideClassProblem(site)); else if( modifier == ASModifier.VIRTUAL ) currentScope.addProblem(new VirtualOutsideClassProblem(site)); else if( modifier == ASModifier.ABSTRACT ) currentScope.addProblem(new AbstractOutsideClassProblem(site)); }
@Override public boolean apply(ICompilerProblem problem) { return problem.getLine() == line; } @Override
/** * Translate a FunctionNode AST into ABC. * Subclasses should override this if * they can process function definitions. * @param f - the function's AST. */ void declareFunction(FunctionNode f) { problems.add(new BURMDiagnosticNotAllowedHereProblem(f)); }
public OperandStackUnderflowProblem(IFlowgraph cfg, IBasicBlock b, int instructionIndex) { super(computeSourceLocationForBlockAndInstruction(cfg, b, instructionIndex)); } }
public ScopeStackUnderflowProblem(IFlowgraph cfg, IBasicBlock b, int instructionIndex) { super(computeSourceLocationForBlockAndInstruction(cfg, b, instructionIndex)); } }
/** * @param sourcePath Name of source file for which code was being * generated when this problem was found. Must not be null. * @param throwable {@link Throwable} that caused this problem to be created. must not be null. * @param subSystemName is the Compiler module where the problem occurred. For example "ABC generator". Must not be null * * Note that if you do not have the required ctor arguments, you might use InternalCompilerProblem * instead of this class */ public InternalCompilerProblem2(String sourcePath, Throwable throwable, String subSystemName) { super(sourcePath); this.sourcePath = sourcePath; this.subSystemName = subSystemName; this.stackTrace = makeStackTrace(throwable); }
/** * Translate a NamespaceIdentifierNode AST into ABC. * Subclasses should override this if * they can process namespace identifiers. * @param ns - the namespace identifier's AST. */ void processNamespaceIdentifierDirective(NamespaceIdentifierNode ns) { problems.add(new BURMDiagnosticNotAllowedHereProblem(ns)); }
/** * Translate a PackageNode AST into ABC. * Subclasses should override this if * they can process packages. * @param p - the package's AST. */ void declarePackage(PackageNode p) { problems.add(new BURMDiagnosticNotAllowedHereProblem(p)); }
/** * Translate an MXMLDocumentNode AST into ABC. * Subclasses should override this if * they can process document nodes. * @param c - the document's AST. */ void declareMXMLDocument(IMXMLDocumentNode d) { problems.add(new BURMDiagnosticNotAllowedHereProblem(d)); }