Skip to main content

module lang::php::pp::PrettyPrinter

rascal-0.40.17
php-analysis-0.2.4

Usage

import lang::php::pp::PrettyPrinter;

Source code

http://github.com/cwi-swat/php-analysis/blob/main/src/main/rascal/lang/php/pp/PrettyPrinter.rsc

Dependencies

import lang::php::ast::AbstractSyntax;
import List;
import String;
import Set;
import IO;

function pp

str pp(someExpr(Expr expr))

str pp(noExpr())

str pp(someName(Name name))

str pp(noName())

str pp(someElse(Else e))

str pp(noElse())

str pp(actualParameter(Expr e, true, false, noName()))

str pp(actualParameter(Expr e, false, false, noName()))

str pp(actualParameter(Expr e, true, false, someName(Name n)))

str pp(actualParameter(Expr e, false, false, someName(Name n)))

str pp(actualParameter(Expr e, true, true, OptionName _))

str pp(actualParameter(Expr e, false, true, OptionName _))

str pp(variadicPlaceholder())

str pp(Const::const(str name, Expr constValue))

str pp(arrayElement(someExpr(Expr expr), Expr val, true, false))

str pp(arrayElement(someExpr(Expr expr), Expr val, false, false))

str pp(arrayElement(noExpr(), Expr val, true, false))

str pp(arrayElement(noExpr(), Expr val, false, false))

str pp(arrayElement(noExpr(), Expr val, false, true))

str pp(Name::name(str n))

str pp(NameOrExpr::name(Name n))

str pp(NameOrExpr::expr(Expr e))

str pp(\int())

str pp(\bool())

str pp(CastType::float())

str pp(CastType::string())

str pp(CastType::array())

str pp(object())

str pp(CastType::unset())

str pp(closureUse(Expr expr, true))

str pp(closureUse(Expr expr, false))

str pp(IncludeType::include())

str pp(includeOnce())

str pp(require())

str pp(requireOnce())

str pp(explicitClassName(Name name))

str pp(computedClassName(Expr expr))

str pp(anonymousClassDef(Stmt stmt))

str pp(Expr::array(list[ArrayElement] items, false))

str pp(Expr::array(list[ArrayElement] items, true))

str pp(fetchArrayDim(Expr var, someExpr(Expr dim)))

str pp(fetchArrayDim(Expr var, noExpr()))

str pp(fetchClassConst(NameOrExpr className, str constName))

str pp(assign(Expr assignTo, Expr assignExpr))

str pp(assignWOp(Expr assignTo, Expr assignExpr, Op operation))

str pp(listAssign(list[OptionExpr] assignsTo, Expr assignExpr))

str pp(refAssign(Expr assignTo, Expr assignExpr))

str pp(binaryOperation(Expr left, Expr right, Op operation))

str pp(unaryOperation(Expr operand, Op operation))

str pp(unaryOperation(Expr operand, Op operation))

str pp(new(ClassName newClassName, list[ActualParameter] parameters))

str pp(cast(CastType castType, Expr expr))

str pp(clone(Expr expr))

str pp(closure(list[Stmt] statements, list[Param] params, list[ClosureUse] closureUses, false, false, PHPType returnType, _))

str pp(closure(list[Stmt] statements, list[Param] params, list[ClosureUse] closureUses, false, false, PHPType returnType, _))

str pp(closure(_,_,_,_,_,_,_))

str pp(fetchConst(Name name))

str pp(empty(Expr expr))

str pp(suppress(Expr expr))

str pp(eval(Expr expr))

str pp(exit(OptionExpr exitExpr, bool isExit))

str pp(call(NameOrExpr funName, list[ActualParameter] parameters))

str pp(methodCall(Expr target, NameOrExpr methodName, list[ActualParameter] parameters, true))

str pp(methodCall(Expr target, NameOrExpr methodName, list[ActualParameter] parameters, false))

str pp(staticCall(NameOrExpr staticTarget, NameOrExpr methodName, list[ActualParameter] parameters))

str pp(Expr::include(Expr expr, IncludeType includeType))

str pp(instanceOf(Expr expr, NameOrExpr toCompare))

str pp(isSet(list[Expr] exprs))

str pp(Expr::print(Expr expr))

str pp(propertyFetch(Expr target, NameOrExpr propertyName, true))

str pp(propertyFetch(Expr target, NameOrExpr propertyName, false))

str pp(shellExec(list[Expr] parts))

str pp(ternary(Expr c, OptionExpr ib, Expr eb))

str pp(staticPropertyFetch(NameOrExpr cn, NameOrExpr pn))

str pp(scalar(Scalar scalarVal))

str pp(var(NameOrExpr varName))

str pp(yield(noExpr(), noExpr()))

str pp(yield(noExpr(), someExpr(Expr v)))

str pp(yield(someExpr(Expr k), someExpr(Expr v)))

str pp(yield(someExpr(Expr k), noExpr()))

str pp(yieldFrom(Expr f))

str pp(listExpr(list[ArrayElement] listExprs))

str pp(bitwiseAnd())

str pp(bitwiseOr())

str pp(bitwiseXor())

str pp(Op::concat())

str pp(div())

str pp(minus())

str pp(\mod())

str pp(mul())

str pp(plus())

str pp(rightShift())

str pp(leftShift())

str pp(booleanAnd())

str pp(booleanOr())

str pp(booleanNot())

str pp(bitwiseNot())

str pp(gt())

str pp(geq())

str pp(logicalAnd())

str pp(logicalOr())

str pp(logicalXor())

str pp(notEqual())

str pp(notIdentical())

str pp(postDec())

str pp(preDec())

str pp(postInc())

str pp(preInc())

str pp(lt())

str pp(leq())

str pp(unaryPlus())

str pp(unaryMinus())

str pp(equal())

str pp(identical())

str pp(pow())

str pp(coalesce())

str pp(spaceship())

function isUnary

bool isUnary(booleanNot())

bool isUnary(bitwiseNot())

bool isUnary(postDec())

bool isUnary(preDec())

bool isUnary(postInc())

bool isUnary(preInc())

bool isUnary(unaryPlus())

bool isUnary(unaryMinus())

default bool isUnary(Op x)

function ppOnLeft

bool ppOnLeft(booleanNot())

bool ppOnLeft(bitwiseNot())

bool ppOnLeft(postDec())

bool ppOnLeft(preDec())

bool ppOnLeft(postInc())

bool ppOnLeft(preInc())

bool ppOnLeft(unaryPlus())

bool ppOnLeft(unaryMinus())

default bool ppOnLeft(Op x)

function ppOnRight

default bool ppOnRight(Op x)

function pp

str pp(param(str pn, noExpr(), true, true, PHPType returnType, mods, _))

str pp(param(str pn, noExpr(), true, false, PHPType returnType, mods, _))

str pp(param(str pn, noExpr(), false, true, PHPType returnType, mods, _))

str pp(param(str pn, noExpr(), false, false, PHPType returnType, mods, _))

str pp(param(str pn, someExpr(Expr e), true, true, PHPType returnType, mods, _))

str pp(param(str pn, someExpr(Expr e), true, false, PHPType returnType, mods, _))

str pp(param(str pn, someExpr(Expr e), false, true, PHPType returnType, mods, _))

str pp(param(str pn, someExpr(Expr e), false, false, PHPType returnType, mods, _))

function padIfNotEmpty

str padIfNotEmpty(str s)

str padIfNotEmpty(str s)

function pp

str pp(nullableType(PHPType nestedType))

str pp(unionType(list[PHPType] types))

str pp(intersectionType(list[PHPType] types))

str pp(regularType(Name typeName))

str pp(noType())

str pp(classConstant())

str pp(dirConstant())

str pp(fileConstant())

str pp(funcConstant())

str pp(lineConstant())

str pp(methodConstant())

str pp(namespaceConstant())

str pp(traitConstant())

str pp(Scalar::float(real r))

str pp(integer(int i))

str pp(Scalar::string(str s))

str pp(encapsed(list[Expr] parts))

str pp(\break(someExpr(Expr breakExpr)))

str pp(\break(noExpr()))

str pp(classDef(ClassDef classDef))

str pp(Stmt::const(list[Const] consts))

str pp(\continue(someExpr(Expr continueExpr)))

str pp(\continue(noExpr()))

str pp(declare(list[Declaration] decls, list[Stmt] body))

str pp(declare(list[Declaration] decls, list[Stmt] body))

str pp(do(Expr cond, list[Stmt] body))

str pp(echo(list[Expr] exprs))

str pp(exprstmt(Expr expr))

str pp(\for(list[Expr] inits, list[Expr] conds, list[Expr] exprs, list[Stmt] body))

str pp(foreach(Expr arrayExpr, someExpr(Expr keyvar), false, Expr asVar, list[Stmt] body))

str pp(foreach(Expr arrayExpr, someExpr(Expr keyvar), true, Expr asVar, list[Stmt] body))

str pp(foreach(Expr arrayExpr, noExpr(), false, Expr asVar, list[Stmt] body))

str pp(foreach(Expr arrayExpr, noExpr(), true, Expr asVar, list[Stmt] body))

str pp(function(str name, true, list[Param] params, list[Stmt] body, PHPType returnType,_))

str pp(function(str name, false, list[Param] params, list[Stmt] body, PHPType returnType,_))

str pp(global(list[Expr] exprs))

str pp(goto(str label))

str pp(haltCompiler(str remainingText))

str pp(\if(Expr cond, list[Stmt] body, list[ElseIf] elseIfs, noElse()))

str pp(\if(Expr cond, list[Stmt] body, list[ElseIf] elseIfs, someElse(Else elseClause)))

str pp(\if(Expr cond, list[Stmt] body, list[ElseIf] elseIfs, noElse()))

str pp(\if(Expr cond, list[Stmt] body, list[ElseIf] elseIfs, someElse(Else elseClause)))

str pp(inlineHTML(str htmlText))

str pp(interfaceDef(InterfaceDef interfaceDef))

str pp(traitDef(TraitDef traitDef))

str pp(label(str labelName))

str pp(namespaceHeader(namespaceName))

str pp(namespace(someName(Name nsName), list[Stmt] body))

str pp(namespace(noName(), list[Stmt] body))

str pp(\return(someExpr(Expr returnExpr)))

str pp(\return(noExpr()))

str pp(Stmt::static(list[StaticVar] vars))

str pp(\switch(Expr cond, list[Case] cases))

str pp(\throw(Expr expr))

str pp(tryCatch(list[Stmt] body, list[Catch] catches))

str pp(tryCatchFinally(list[Stmt] body, list[Catch] catches, list[Stmt] finallyBody))

str pp(Stmt::unset(list[Expr] unsetVars))

str pp(Stmt::useStmt(list[Use] uses, OptionName prefixName, UseType useType))

str pp(\while(Expr cond, list[Stmt] body))

str pp(emptyStmt())

str pp(block(list[Stmt] body))

str pp(declaration(str key, Expr val))

str pp(\catch(list[Name] xtypes, str varName, list[Stmt] body))

str pp(\case(noExpr(), list[Stmt] body))

str pp(\case(noExpr(), list[Stmt] body))

str pp(\case(someExpr(Expr e), list[Stmt] body))

str pp(\case(someExpr(Expr e), list[Stmt] body))

str pp(elseIf(Expr cond, list[Stmt] body))

str pp(\else(list[Stmt] body))

str pp(Use::use(Name importName, someName(Name asName), UseType useType))

str pp(Use::use(Name importName, noName(), UseType useType))

str pp(ClassItem::property(set[Modifier] modifiers, list[Property] prop, PHPType ptype, _))

str pp(constCI(list[Const] consts, set[Modifier] modifiers, _))

str pp(method(str name, set[Modifier] modifiers, true, list[Param] params, list[Stmt] body, PHPType returnType, _))

str pp(method(str name, set[Modifier] modifiers, true, list[Param] params, list[Stmt] body, PHPType returnType, _))

str pp(method(str name, set[Modifier] modifiers, false, list[Param] params, list[Stmt] body, PHPType returnType, _))

str pp(method(str name, set[Modifier] modifiers, false, list[Param] params, list[Stmt] body, PHPType returnType, _))

str pp(traitUse(list[Name] traits, list[Adaptation] adaptations))

str pp(traitAlias(noName(), str methName, set[Modifier] newModifiers, noName()))

str pp(traitAlias(noName(), str methName, set[Modifier] newModifiers, someName(newName)))

str pp(traitAlias(someName(traitName), str methName, set[Modifier] newModifiers, noName()))

str pp(traitAlias(someName(traitName), str methName, set[Modifier] newModifiers, someName(newName)))

str pp(traitPrecedence(noName(), str methName, set[Name] insteadOf))

str pp(traitPrecedence(someName(traitName), str methName, set[Name] insteadOf))

str pp(Property::property(str propertyName, someExpr(Expr defaultValue)))

str pp(Property::property(str propertyName, noExpr()))

str pp(\public())

str pp(\private())

str pp(\protected())

str pp(Modifier::\static())

str pp(\abstract())

str pp(\final())

str pp(\readonly())

str pp(class(str className, set[Modifier] modifiers, someName(Name extends), list[Name] implements, list[ClassItem] members, _))

str pp(class(str className, set[Modifier] modifiers, noName(), list[Name] implements, list[ClassItem] members, _))

str pp(class(str className, set[Modifier] modifiers, someName(Name extends), list[Name] implements, list[ClassItem] members, _))

str pp(class(str className, set[Modifier] modifiers, noName(), list[Name] implements, list[ClassItem] members, _))

str pp(class(str className, set[Modifier] modifiers, someName(Name extends), list[Name] implements, list[ClassItem] members, _))

str pp(class(str className, set[Modifier] modifiers, noName(), list[Name] implements, list[ClassItem] members, _))

str pp(class(str className, set[Modifier] modifiers, someName(Name extends), list[Name] implements, list[ClassItem] members, _))

str pp(class(str className, set[Modifier] modifiers, noName(), list[Name] implements, list[ClassItem] members, _))

str pp(anonymousClass(someName(Name extends), list[Name] implements, list[ClassItem] members, _))

str pp(anonymousClass(noName(), list[Name] implements, list[ClassItem] members, _))

str pp(anonymousClass(someName(Name extends), list[Name] implements, list[ClassItem] members, _))

str pp(anonymousClass(noName(), list[Name] implements, list[ClassItem] members, _))

str pp(interface(str interfaceName, list[Name] extends, list[ClassItem] members, _))

str pp(interface(str interfaceName, list[Name] extends, list[ClassItem] members, _))

str pp(trait(str traitName, list[ClassItem] members, _))

str pp(staticVar(str vname, someExpr(Expr defaultValue)))

str pp(staticVar(str vname, noExpr()))

str pp(script(list[Stmt] body))

str pp(errscript(str err))

str pp(str text)

default str pp(node n)