Package de.monticore.types3.util
Class SymTypePrintVisitor
- java.lang.Object
-
- de.monticore.types3.util.SymTypePrintVisitor
-
- All Implemented Interfaces:
ISymTypeVisitor
- Direct Known Subclasses:
SymTypePrintFullNameVisitor
public class SymTypePrintVisitor extends java.lang.Object implements ISymTypeVisitor
prints SymTypeExpressions s.SymTypeExpression.print()Some of the print methods are dependent on each other with regard to the printing of parentheses.
* Usage: calculate(mySymType)
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringBOTTOM_PRINTprotected static java.lang.StringOBSCURE_PRINTprotected java.lang.StringBuilderprintprotected static java.lang.StringTOP_PRINT
-
Constructor Summary
Constructors Constructor Description SymTypePrintVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringcalculate(SymTypeExpression symType)uses this visitor with the provided symType and returns the result.protected java.lang.StringBuildergetPrint()protected booleanisTypePrintedAsInfix(SymTypeExpression symType)returns whether the type is printed as TypeA 'operator' TypeBprotected voidprintClosingBracketForInner(SymTypeExpression symType)prints a closing bracket if required for the inner typeprotected voidprintOpeningBracketForInner(SymTypeExpression symType)prints an opening bracket if required for the inner typeprotected java.lang.StringprintTypeSymbol(TypeSymbol symbol)protected java.lang.StringprintTypeVarSymbol(TypeVarSymbol symbol)voidreset()voidvisit(SymTypeArray symType)voidvisit(SymTypeInferenceVariable symType)voidvisit(SymTypeObscure symType)voidvisit(SymTypeOfFunction symType)voidvisit(SymTypeOfGenerics symType)voidvisit(SymTypeOfIntersection symType)voidvisit(SymTypeOfNull symType)voidvisit(SymTypeOfObject symType)voidvisit(SymTypeOfRegEx symType)voidvisit(SymTypeOfTuple symType)voidvisit(SymTypeOfUnion symType)voidvisit(SymTypeOfWildcard symType)voidvisit(SymTypePrimitive symType)voidvisit(SymTypeVariable symType)voidvisit(SymTypeVoid symType)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.monticore.types3.ISymTypeVisitor
visit, visit
-
-
-
-
Field Detail
-
TOP_PRINT
protected static final java.lang.String TOP_PRINT
- See Also:
- Constant Field Values
-
BOTTOM_PRINT
protected static final java.lang.String BOTTOM_PRINT
- See Also:
- Constant Field Values
-
OBSCURE_PRINT
protected static final java.lang.String OBSCURE_PRINT
- See Also:
- Constant Field Values
-
print
protected java.lang.StringBuilder print
-
-
Method Detail
-
getPrint
protected java.lang.StringBuilder getPrint()
-
reset
public void reset()
-
visit
public void visit(SymTypeArray symType)
- Specified by:
visitin interfaceISymTypeVisitor
-
visit
public void visit(SymTypeInferenceVariable symType)
- Specified by:
visitin interfaceISymTypeVisitor
-
visit
public void visit(SymTypeObscure symType)
- Specified by:
visitin interfaceISymTypeVisitor
-
visit
public void visit(SymTypeOfFunction symType)
- Specified by:
visitin interfaceISymTypeVisitor
-
visit
public void visit(SymTypeOfGenerics symType)
- Specified by:
visitin interfaceISymTypeVisitor
-
visit
public void visit(SymTypeOfIntersection symType)
- Specified by:
visitin interfaceISymTypeVisitor
-
visit
public void visit(SymTypeOfNull symType)
- Specified by:
visitin interfaceISymTypeVisitor
-
visit
public void visit(SymTypeOfObject symType)
- Specified by:
visitin interfaceISymTypeVisitor
-
visit
public void visit(SymTypeOfRegEx symType)
- Specified by:
visitin interfaceISymTypeVisitor
-
visit
public void visit(SymTypeOfTuple symType)
- Specified by:
visitin interfaceISymTypeVisitor
-
visit
public void visit(SymTypeOfUnion symType)
- Specified by:
visitin interfaceISymTypeVisitor
-
visit
public void visit(SymTypePrimitive symType)
- Specified by:
visitin interfaceISymTypeVisitor
-
visit
public void visit(SymTypeVariable symType)
- Specified by:
visitin interfaceISymTypeVisitor
-
visit
public void visit(SymTypeVoid symType)
- Specified by:
visitin interfaceISymTypeVisitor
-
visit
public void visit(SymTypeOfWildcard symType)
- Specified by:
visitin interfaceISymTypeVisitor
-
printTypeSymbol
protected java.lang.String printTypeSymbol(TypeSymbol symbol)
-
printTypeVarSymbol
protected java.lang.String printTypeVarSymbol(TypeVarSymbol symbol)
-
calculate
public java.lang.String calculate(SymTypeExpression symType)
uses this visitor with the provided symType and returns the result. it is reset during the process.
-
printOpeningBracketForInner
protected void printOpeningBracketForInner(SymTypeExpression symType)
prints an opening bracket if required for the inner type
-
printClosingBracketForInner
protected void printClosingBracketForInner(SymTypeExpression symType)
prints a closing bracket if required for the inner type
-
isTypePrintedAsInfix
protected boolean isTypePrintedAsInfix(SymTypeExpression symType)
returns whether the type is printed as TypeA 'operator' TypeB
-
-