function parseNamedExpression($ast, &$list) { $name = ast_get($ast, NodeKey::NAME); $value = parseExpression(ast_get($ast, NodeKey::VALUE)); if (is_numeric($name)) { $name = '_expr' . $name . '_'; } $list[$name] = $value; }
public function __construct(&$src_info) { $this->file = ast_get($src_info, NodeKey::FILENAME); $this->line = ast_get($src_info, NodeKey::LINE); $this->col = ast_get($src_info, NodeKey::COL); }
function parseClusterWP($ast, $name, $header) { ob_start(); LibraryManager::Push(); $res = new GenerationInfo(); /*************** PROCESS AST ***************/ $attr = lookupAttribute(ast_get($ast, NodeKey::PAYLOAD)); $attrType = $attr->type(); grokit_assert($attrType->is('clusterable'), 'Attempting to cluster on unclusterable attribute ' . $attr->name()); /*************** END PROCESS AST ***************/ // Get our headers $myHeaders = $header . PHP_EOL . ob_get_clean(); $filename = $name . '.cc'; $res->addFile($filename, $name); _startFile($filename); ClusterGenerate($name, $attr); _endFile($filename, $myHeaders); LibraryManager::Pop(); return $res; }