// Delete once migrated to PastelContext internal string GetFunctionDeclarationsTEMP(Transpilers.TranspilerContext ctx, string indent) { foreach (FunctionDefinition fd in this.GetFunctionDefinitions()) { ctx.Transpiler.GenerateCodeForFunctionDeclaration(ctx, fd, true); ctx.Append(ctx.Transpiler.NewLine); } return(Indent(ctx.FlushAndClearBuffer().Trim(), ctx.Transpiler.NewLine, indent)); }
// Delete once migrated to PastelContext internal string GetFunctionCodeTEMP(Transpilers.TranspilerContext ctx, string indent) { foreach (FunctionDefinition fd in this.GetFunctionDefinitions()) { if (!alreadySerializedFunctions.Contains(fd)) { this.Transpiler.GenerateCodeForFunction(ctx, fd); ctx.Append(this.Transpiler.NewLine); } } return(Indent(ctx.FlushAndClearBuffer().Trim(), this.Transpiler.NewLine, indent)); }
public override void TranslateGetResourceManifest(TranspilerContext sb) { sb.Append("C$common$resourceManifest"); }
public override void TranslateStringAppend(TranspilerContext sb, Expression str1, Expression str2) { this.TranslateExpression(sb, str1); sb.Append(" += "); this.TranslateExpression(sb, str2); }
public override void TranslateSetProgramData(TranspilerContext sb, Expression programData) { sb.Append("C$common$programData = "); this.TranslateExpression(sb, programData); }
public override void TranslateBase64ToString(TranspilerContext sb, Expression base64String) { sb.Append("C$common$base64ToString("); this.TranslateExpression(sb, base64String); sb.Append(')'); }
public override void TranslateRandomFloat(TranspilerContext sb) { sb.Append("Math.random()"); }
public override void TranslateParseInt(TranspilerContext sb, Expression safeStringValue) { sb.Append("parseInt("); this.TranslateExpression(sb, safeStringValue); sb.Append(')'); }
public override void TranslateListJoinChars(TranspilerContext sb, Expression list) { this.TranslateExpression(sb, list); sb.Append(".join('')"); }
public override void TranslateArrayLength(TranspilerContext sb, Expression array) { this.TranslateExpression(sb, array); sb.Append(".length"); }
public override void TranslateListClear(TranspilerContext sb, Expression list) { sb.Append("C$common$clearList("); this.TranslateExpression(sb, list); sb.Append(')'); }
public override void TranslateIsValidInteger(TranspilerContext sb, Expression stringValue) { sb.Append("C$common$is_valid_integer("); this.TranslateExpression(sb, stringValue); sb.Append(')'); }
public override void TranslateIntToString(TranspilerContext sb, Expression integer) { sb.Append("('' + "); this.TranslateExpression(sb, integer); sb.Append(')'); }
public override void TranslateIntBuffer16(TranspilerContext sb) { sb.Append("C$common$intBuffer16"); }
public override void TranslateGlobalVariable(TranspilerContext sb, Variable variable) { sb.Append("v_"); sb.Append(variable.Name); }
public override void TranslateMathTan(TranspilerContext sb, Expression thetaRadians) { sb.Append("Math.tan("); this.TranslateExpression(sb, thetaRadians); sb.Append(')'); }
public override void TranslateNullConstant(TranspilerContext sb) { sb.Append("null"); }
public override void TranslateListNew(TranspilerContext sb, PType type) { sb.Append("[]"); }
public override void TranslatePrintStdOut(TranspilerContext sb, Expression value) { sb.Append("C$common$print("); this.TranslateExpression(sb, value); sb.Append(')'); }
public override void TranslateArrayNew(TranspilerContext sb, PType arrayType, Expression lengthExpression) { sb.Append("C$common$createNewArray("); this.TranslateExpression(sb, lengthExpression); sb.Append(')'); }
public override void TranslateReadByteCodeFile(TranspilerContext sb) { sb.Append("C$bytecode"); }
public override void TranslateListReverse(TranspilerContext sb, Expression list) { this.TranslateExpression(sb, list); sb.Append(".reverse()"); }
public override void TranslateResourceReadTextFile(TranspilerContext sb, Expression path) { sb.Append("C$common$readResourceText("); this.TranslateExpression(sb, path); sb.Append(')'); }
public override void TranslateListShuffle(TranspilerContext sb, Expression list) { sb.Append("C$common$shuffle("); this.TranslateExpression(sb, list); sb.Append(')'); }
public override void TranslateSortedCopyOfStringArray(TranspilerContext sb, Expression stringArray) { sb.Append("C$common$sortedCopyOfArray("); this.TranslateExpression(sb, stringArray); sb.Append(')'); }
public override void TranslateListSize(TranspilerContext sb, Expression list) { this.TranslateExpression(sb, list); sb.Append(".length"); }
public override void TranslateStringBuffer16(TranspilerContext sb) { sb.Append("C$common$stringBuffer16"); }
public override void TranslateMathArcSin(TranspilerContext sb, Expression ratio) { sb.Append("Math.asin("); this.TranslateExpression(sb, ratio); sb.Append(')'); }
public override void TranslateMathLog(TranspilerContext sb, Expression value) { sb.Append("Math.log("); this.TranslateExpression(sb, value); sb.Append(')'); }
public override void TranslateGetProgramData(TranspilerContext sb) { sb.Append("C$common$programData"); }