Search in sources :

Example 6 with IdeDeclaration

use of net.jangaroo.jooc.ast.IdeDeclaration in project jangaroo-tools by CoreMedia.

the class JsCodeGenerator method getFunctionNameAsIde.

public String getFunctionNameAsIde(FunctionExpr functionExpr) {
    IdeDeclaration classDeclaration = functionExpr.getClassDeclaration();
    String classNameAsIde = "";
    if (classDeclaration != null) {
        classNameAsIde = out.getQualifiedNameAsIde(classDeclaration);
    }
    JooSymbol sym = functionExpr.getSymbol();
    return classNameAsIde + "$" + sym.getLine() + "_" + sym.getColumn();
}
Also used : IdeDeclaration(net.jangaroo.jooc.ast.IdeDeclaration) TypedIdeDeclaration(net.jangaroo.jooc.ast.TypedIdeDeclaration) JooSymbol(net.jangaroo.jooc.JooSymbol)

Example 7 with IdeDeclaration

use of net.jangaroo.jooc.ast.IdeDeclaration in project jangaroo-tools by CoreMedia.

the class JangarooParser method declareValues.

protected static void declareValues(Scope scope, String[] identifiers) {
    for (String identifier : identifiers) {
        Ide ide = new Ide(new JooSymbol(identifier));
        IdeDeclaration decl = new VariableDeclaration(new JooSymbol("var"), ide, null, null);
        decl.scope(scope);
    }
}
Also used : IdeDeclaration(net.jangaroo.jooc.ast.IdeDeclaration) VariableDeclaration(net.jangaroo.jooc.ast.VariableDeclaration) Ide(net.jangaroo.jooc.ast.Ide)

Example 8 with IdeDeclaration

use of net.jangaroo.jooc.ast.IdeDeclaration in project jangaroo-tools by CoreMedia.

the class JangarooParser method declareType.

private static void declareType(Scope scope, String identifier) {
    IdeDeclaration decl = new PredefinedTypeDeclaration(identifier);
    decl.scope(scope);
}
Also used : PredefinedTypeDeclaration(net.jangaroo.jooc.ast.PredefinedTypeDeclaration) IdeDeclaration(net.jangaroo.jooc.ast.IdeDeclaration)

Aggregations

IdeDeclaration (net.jangaroo.jooc.ast.IdeDeclaration)8 TypedIdeDeclaration (net.jangaroo.jooc.ast.TypedIdeDeclaration)5 Ide (net.jangaroo.jooc.ast.Ide)3 QualifiedIde (net.jangaroo.jooc.ast.QualifiedIde)3 ImportDirective (net.jangaroo.jooc.ast.ImportDirective)2 NamespacedIde (net.jangaroo.jooc.ast.NamespacedIde)2 VariableDeclaration (net.jangaroo.jooc.ast.VariableDeclaration)2 IOException (java.io.IOException)1 CodeGenerator (net.jangaroo.jooc.CodeGenerator)1 JooSymbol (net.jangaroo.jooc.JooSymbol)1 JsWriter (net.jangaroo.jooc.JsWriter)1 ApplyExpr (net.jangaroo.jooc.ast.ApplyExpr)1 ArrayIndexExpr (net.jangaroo.jooc.ast.ArrayIndexExpr)1 AsExpr (net.jangaroo.jooc.ast.AsExpr)1 AssignmentOpExpr (net.jangaroo.jooc.ast.AssignmentOpExpr)1 BlockStatement (net.jangaroo.jooc.ast.BlockStatement)1 Directive (net.jangaroo.jooc.ast.Directive)1 DotExpr (net.jangaroo.jooc.ast.DotExpr)1 Expr (net.jangaroo.jooc.ast.Expr)1 FunctionExpr (net.jangaroo.jooc.ast.FunctionExpr)1