本文整理汇总了C++中Assignment::variable方法的典型用法代码示例。如果您正苦于以下问题:C++ Assignment::variable方法的具体用法?C++ Assignment::variable怎么用?C++ Assignment::variable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assignment
的用法示例。
在下文中一共展示了Assignment::variable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: debug_ast
//.........这里部分代码省略.........
} else if (dynamic_cast<Return*>(node)) {
Return* block = dynamic_cast<Return*>(node);
std::cerr << ind << "Return " << block;
std::cerr << " (" << pstate_source_position(node) << ")";
std::cerr << " " << block->tabs() << std::endl;
} else if (dynamic_cast<Extension*>(node)) {
Extension* block = dynamic_cast<Extension*>(node);
std::cerr << ind << "Extension " << block;
std::cerr << " (" << pstate_source_position(node) << ")";
std::cerr << " " << block->tabs() << std::endl;
debug_ast(block->selector(), ind + "-> ", env);
} else if (dynamic_cast<Content*>(node)) {
Content* block = dynamic_cast<Content*>(node);
std::cerr << ind << "Content " << block;
std::cerr << " (" << pstate_source_position(node) << ")";
std::cerr << " " << block->tabs() << std::endl;
} else if (dynamic_cast<Import_Stub*>(node)) {
Import_Stub* block = dynamic_cast<Import_Stub*>(node);
std::cerr << ind << "Import_Stub " << block;
std::cerr << " (" << pstate_source_position(node) << ")";
std::cerr << " " << block->tabs() << std::endl;
} else if (dynamic_cast<Import*>(node)) {
Import* block = dynamic_cast<Import*>(node);
std::cerr << ind << "Import " << block;
std::cerr << " (" << pstate_source_position(node) << ")";
std::cerr << " " << block->tabs() << std::endl;
debug_ast(block->media_queries(), ind + " @ ");
// std::vector<std::string> files_;
for (auto imp : block->urls()) debug_ast(imp, "@ ", env);
} else if (dynamic_cast<Assignment*>(node)) {
Assignment* block = dynamic_cast<Assignment*>(node);
std::cerr << ind << "Assignment " << block;
std::cerr << " (" << pstate_source_position(node) << ")";
std::cerr << " <<" << block->variable() << ">> " << block->tabs() << std::endl;
debug_ast(block->value(), ind + "=", env);
} else if (dynamic_cast<Declaration*>(node)) {
Declaration* block = dynamic_cast<Declaration*>(node);
std::cerr << ind << "Declaration " << block;
std::cerr << " (" << pstate_source_position(node) << ")";
std::cerr << " " << block->tabs() << std::endl;
debug_ast(block->property(), ind + " prop: ", env);
debug_ast(block->value(), ind + " value: ", env);
} else if (dynamic_cast<Keyframe_Rule*>(node)) {
Keyframe_Rule* has_block = dynamic_cast<Keyframe_Rule*>(node);
std::cerr << ind << "Keyframe_Rule " << has_block;
std::cerr << " (" << pstate_source_position(node) << ")";
std::cerr << " " << has_block->tabs() << std::endl;
if (has_block->selector()) debug_ast(has_block->selector(), ind + "@");
if (has_block->block()) for(auto i : has_block->block()->elements()) { debug_ast(i, ind + " ", env); }
} else if (dynamic_cast<At_Rule*>(node)) {
At_Rule* block = dynamic_cast<At_Rule*>(node);
std::cerr << ind << "At_Rule " << block;
std::cerr << " (" << pstate_source_position(node) << ")";
std::cerr << " [" << block->keyword() << "] " << block->tabs() << std::endl;
debug_ast(block->selector(), ind + "~", env);
debug_ast(block->value(), ind + "+", env);
if (block->block()) for(auto i : block->block()->elements()) { debug_ast(i, ind + " ", env); }
} else if (dynamic_cast<Each*>(node)) {
Each* block = dynamic_cast<Each*>(node);
std::cerr << ind << "Each " << block;
std::cerr << " (" << pstate_source_position(node) << ")";
std::cerr << " " << block->tabs() << std::endl;
if (block->block()) for(auto i : block->block()->elements()) { debug_ast(i, ind + " ", env); }
} else if (dynamic_cast<For*>(node)) {
For* block = dynamic_cast<For*>(node);
std::cerr << ind << "For " << block;
示例2: debug_ast
//.........这里部分代码省略.........
Error* block = dynamic_cast<Error*>(node);
cerr << ind << "Error " << block << " " << block->tabs() << endl;
} else if (dynamic_cast<Debug*>(node)) {
Debug* block = dynamic_cast<Debug*>(node);
cerr << ind << "Debug " << block << " " << block->tabs() << endl;
} else if (dynamic_cast<Comment*>(node)) {
Comment* block = dynamic_cast<Comment*>(node);
cerr << ind << "Comment " << block << " " << block->tabs() <<
" <" << prettyprint(block->pstate().token.ws_before()) << ">" << endl;
debug_ast(block->text(), ind + "// ", env);
} else if (dynamic_cast<If*>(node)) {
If* block = dynamic_cast<If*>(node);
cerr << ind << "If " << block << " " << block->tabs() << endl;
} else if (dynamic_cast<Return*>(node)) {
Return* block = dynamic_cast<Return*>(node);
cerr << ind << "Return " << block << " " << block->tabs() << endl;
} else if (dynamic_cast<Extension*>(node)) {
Extension* block = dynamic_cast<Extension*>(node);
cerr << ind << "Extension " << block << " " << block->tabs() << endl;
debug_ast(block->selector(), ind + "-> ", env);
} else if (dynamic_cast<Content*>(node)) {
Content* block = dynamic_cast<Content*>(node);
cerr << ind << "Content " << block << " " << block->tabs() << endl;
} else if (dynamic_cast<Import_Stub*>(node)) {
Import_Stub* block = dynamic_cast<Import_Stub*>(node);
cerr << ind << "Import_Stub " << block << " " << block->tabs() << endl;
} else if (dynamic_cast<Import*>(node)) {
Import* block = dynamic_cast<Import*>(node);
cerr << ind << "Import " << block << " " << block->tabs() << endl;
// vector<string> files_;
for (auto imp : block->urls()) debug_ast(imp, "@ ", env);
} else if (dynamic_cast<Assignment*>(node)) {
Assignment* block = dynamic_cast<Assignment*>(node);
cerr << ind << "Assignment " << block << " <<" << block->variable() << ">> " << block->tabs() << endl;
debug_ast(block->value(), ind + "=", env);
} else if (dynamic_cast<Declaration*>(node)) {
Declaration* block = dynamic_cast<Declaration*>(node);
cerr << ind << "Declaration " << block << " " << block->tabs() << endl;
debug_ast(block->property(), ind + " prop: ", env);
debug_ast(block->value(), ind + " value: ", env);
} else if (dynamic_cast<Keyframe_Rule*>(node)) {
Keyframe_Rule* has_block = dynamic_cast<Keyframe_Rule*>(node);
cerr << ind << "Keyframe_Rule " << has_block << " " << has_block->tabs() << endl;
if (has_block->selector()) debug_ast(has_block->selector(), ind + "@");
if (has_block->block()) for(auto i : has_block->block()->elements()) { debug_ast(i, ind + " ", env); }
} else if (dynamic_cast<At_Rule*>(node)) {
At_Rule* block = dynamic_cast<At_Rule*>(node);
cerr << ind << "At_Rule " << block << " [" << block->keyword() << "] " << block->tabs() << endl;
debug_ast(block->value(), ind + "+", env);
debug_ast(block->selector(), ind + "~", env);
if (block->block()) for(auto i : block->block()->elements()) { debug_ast(i, ind + " ", env); }
} else if (dynamic_cast<Each*>(node)) {
Each* block = dynamic_cast<Each*>(node);
cerr << ind << "Each " << block << " " << block->tabs() << endl;
if (block->block()) for(auto i : block->block()->elements()) { debug_ast(i, ind + " ", env); }
} else if (dynamic_cast<For*>(node)) {
For* block = dynamic_cast<For*>(node);
cerr << ind << "For " << block << " " << block->tabs() << endl;
if (block->block()) for(auto i : block->block()->elements()) { debug_ast(i, ind + " ", env); }
} else if (dynamic_cast<While*>(node)) {
While* block = dynamic_cast<While*>(node);
cerr << ind << "While " << block << " " << block->tabs() << endl;
if (block->block()) for(auto i : block->block()->elements()) { debug_ast(i, ind + " ", env); }
} else if (dynamic_cast<Definition*>(node)) {
Definition* block = dynamic_cast<Definition*>(node);
cerr << ind << "Definition " << block << " " << block->tabs() << endl;