function parseNamedArgValue($ast) { assert_ast_type($ast, [NodeType::LITERAL, NodeType::IDENTIFIER, NodeType::NAMED_ARGS, NodeType::TYPEOF, NodeType::DT, NodeType::GLA, NodeType::GF, NodeType::GT, NodeType::GIST, NodeType::GI, NodeType::NUL, NodeType::FUNCTOR, NodeType::ATTRIBUTE]); $source = ast_node_source($ast); switch (ast_node_type($ast)) { case NodeType::LITERAL: return parseLiteralTemplate($ast); break; case NodeType::IDENTIFIER: return new Identifier(parseIdentifier($ast)); break; case NodeType::DT: case NodeType::TYPEOF: return parseType($ast); break; case NodeType::ATTRIBUTE: return parseAttribute($ast); break; case NodeType::NAMED_ARGS: return parseNamedArgList($ast); break; case NodeType::FUNCTOR: return parseFunctor($ast); break; case NodeType::GLA: return parseGLA($ast); break; case NodeType::GF: return parseGF($ast); break; case NodeType::GT: return parseGT($ast); break; case NodeType::GIST: return parseGIST($ast); break; case NodeType::GI: return parseGI($ast); break; case NodeType::NUL: return null; break; } }
$Att[6] = $Rock; $Att[7] = $Bug; $Att[8] = $Ghost; $Att[9] = $Fire; $Att[10] = $Water; $Att[11] = $Grass; $Att[12] = $Electric; $Att[13] = $Psychic; $Att[14] = $Ice; $Att[15] = $Dragon; } function sendtoTable() { global $Att; //Populate Each row at a time for ($y = 0; $y < count($Att[0]); $y++) { //INSERT INTO TYPE_IN (TNAME,NORMAL,FIGHTING....) //VALUES ( $Att[0][$y], $Att[1][$y].......) } } function printAll() { global $Att; for ($y = 0; $y < count($Att[0]); $y++) { echo $Att[0][$y] . " " . $Att[1][$y] . " " . $Att[2][$y]; } } //============================================= parseType(); sendtoTable(); printAll();
public function evalType() { parseType($this->type_ast); }