Exemplo n.º 1
0
void CodeWriter::RunButLast(char delimiter, const ast::NodeList& nodes) {
  CodeWriter self;

  if (nodes.size()) {
    for (uint i = 0; i < nodes.size() - 1; ++i) {
      nodes[i]->Accept(&self);
      get_pipe()(delimiter);
    }
  }
}
Exemplo n.º 2
0
void CodeWriter::RunList(char delimiter, const ast::NodeList& nodes) {
  CodeWriter self;

  if (nodes.size()) {
    RunButLast(delimiter, nodes);
    nodes.back()->Accept(&self);
  }
}
    //----------------------------------------------------------------------------
    void EvaluatorVisitor::visit( const AST::FunctionExpression* const node )
    {
        ScalarList evaluatedArgs;
        AST::NodeList params = node->getParameterList();

        for ( unsigned int i = 0; i < params.size(); ++i )
        {
            AST::INode* argNode = params[ i ];
            argNode->accept( this );
            evaluatedArgs.push_back( mBranchValue );
        }

        //process function
        mSymbolTable.evaluateFunction( mBranchValue, node->getName(), evaluatedArgs );
    }