Package de.monticore.codegen
Class AbstractCodeGenVisitor
java.lang.Object
de.monticore.codegen.AbstractCodeGenVisitor
- All Implemented Interfaces:
CodeGenerator,de.monticore.visitor.IHandler
- Direct Known Subclasses:
AbstractJavaGenVisitor
public abstract class AbstractCodeGenVisitor
extends Object
implements CodeGenerator, de.monticore.visitor.IHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected static final Stringprotected de.monticore.prettyprint.IndentPrinter -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractCodeGenVisitor(de.monticore.prettyprint.IndentPrinter printer) -
Method Summary
Modifier and TypeMethodDescriptiongenerateCode(de.monticore.ast.ASTNode node) Generates code for the given ASTNode.de.monticore.prettyprint.IndentPrinterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.monticore.visitor.IHandler
getTraverser, handle, handle, handle, handle, handle, traverse, traverse
-
Field Details
-
LOG_NAME
- See Also:
-
isWithinGenerateCode
protected boolean isWithinGenerateCode -
printer
protected de.monticore.prettyprint.IndentPrinter printer
-
-
Constructor Details
-
AbstractCodeGenVisitor
protected AbstractCodeGenVisitor(de.monticore.prettyprint.IndentPrinter printer)
-
-
Method Details
-
generateCode
Generates code for the given ASTNode.This method may not be called recursively, as the buffer is cleared.
- Specified by:
generateCodein interfaceCodeGenerator- Parameters:
node- The node to generate code for.- Returns:
- the generated code
-
getPrinter
public de.monticore.prettyprint.IndentPrinter getPrinter()- Specified by:
getPrinterin interfaceCodeGenerator- Returns:
- the printer storing the (intermediate/final results)
-