Beispiel #1
0
FuncStartNode* handleFuncAssignmentStart(const std::string& name, FuncArgsNode* args)
{
    FuncStartNode* node = new FuncStartNode(name, args);
    node->setLocation(FileLocation(yylineno));
    return node;
#if 0
    // We are dealing with a function
    if (SymbolTable::isFunctionDeclared(name)) {
        // Set the scope name for the following block (the function itself)
        // Will be "undone" in handleFuncAssignment
        SymbolTable::setCurrentFunction(name);
        return new FuncStartNode(name, args);
    }
    // We are dealing with a defined stencil variable
    else if (SymbolTable::isVariableDeclared(name)) {
        return handleStencilAccess(name, args);
    }
    // We are dealing with an undefined stencil variable
    else {
        EquelleType type(Invalid, Collection);
        type.setStencil(true);
        SymbolTable::declareVariable(name, type);
        return handleStencilAccess(name, args);
    }
#endif
}
void PrintEquelleASTVisitor::visit(FuncStartNode& node)
{
    std::cout << indent() << node.name() << '(';
    ++indent_;
}
Beispiel #3
0
void PrintASTVisitor::visit(FuncStartNode& node)
{
    std::cout << indent() << "FuncStartNode: " << node.name() << '\n';
    ++indent_;
}