Fan

 

class

compilerJavascript::JavascriptWriter

sys::Obj
  compiler::CompilerSupport
    compilerJavascript::JavascriptWriter

Generates a Javascript source file from a TypeDef AST.

Slots

assignExprSource

Void assignExpr(BinaryExpr be)

blockSource

Void block(Block block, Bool braces := true, Bool indent := true)

callExprSource

Void callExpr(CallExpr ce)

closureExprSource

Void closureExpr(ClosureExpr ce)

closureLevelSource

Int closureLevel := 0

condExprSource

Void condExpr(CondExpr ce)

ctorSource

Void ctor(MethodDef m)

ctorsSource

MethodDef[] ctors := [,]

elvisExprSource

Void elvisExpr(BinaryExpr be)

exprSource

Void expr(Expr ex)

exprStmtSource

Void exprStmt(Expr ex)

fieldSource

Void field(FieldDef f, Bool trailingComma)

fieldExprSource

Void fieldExpr(FieldExpr fe, Bool get := true)

forStmtSource

Void forStmt(ForStmt fs)

ifStmtSource

Void ifStmt(IfStmt fs)

inClosureSource

Bool inClosure()

Return true if we are inside a closure.

inStaticInitSource

Bool inStaticInit := false

isObjMethodSource

Bool isObjMethod(Str methodName)

isPrimitiveSource

Bool isPrimitive(Str qname)

listLiteralExprSource

Void listLiteralExpr(ListLiteralExpr le)

localDefSource

Void localDef(LocalDefStmt lds)

makeSource

new make(Compiler compiler, TypeDef typeDef, OutStream out)

Constructor takes the associated Compiler

mapLiteralExprSource

Void mapLiteralExpr(MapLiteralExpr me)

methodSource

Void method(MethodDef m, Bool trailingComma)

objMethodMapSource

const Str:Bool objMethodMap := ...

outSource

AstWriter out

primitiveMapSource

const Str:Bool primitiveMap := ...

qnameSource

Str qname(CType ctype)

Return the Javascript qname for this TypeDef. The Javascript qname is <pod>_<type>:

foo::Bar  ->  foo_Bar
rangeLiteralExprSource

Void rangeLiteralExpr(RangeLiteralExpr re)

returnStmtSource

Void returnStmt(ReturnStmt rs)

shortcutExprSource

Void shortcutExpr(ShortcutExpr se)

staticFieldSource

Void staticField(FieldDef f)

staticFieldsSource

FieldDef[] staticFields := [,]

staticInitSource

Void staticInit(Block code)

staticInitsSource

Block[] staticInits := [,]

staticMethodSource

Void staticMethod(MethodDef m)

staticMethodsSource

MethodDef[] staticMethods := [,]

stmtSource

Void stmt(Stmt stmt, Bool nl := true)

switchStmtSource

Void switchStmt(SwitchStmt ss)

throwStmtSource

Void throwStmt(ThrowStmt ts)

tryStmtSource

Void tryStmt(TryStmt ts)

typeCheckExprSource

Void typeCheckExpr(TypeCheckExpr te)

typeDefSource

TypeDef typeDef

varSource

Str var(Str name)

varsSource

const Str:Bool vars := ...

whileStmtSource

Void whileStmt(WhileStmt ws)

withBlockExprSource

Void withBlockExpr(WithBlockExpr wbe)

writeSource

Void write()