MCPcopy Create free account
hub / github.com/Gusabary/FlowChar / printTokenList

Method printTokenList

src/codeParser.cpp:87–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87void CodeParser::printTokenList() {
88 for (Token *token : this->tokenList) {
89 if (token->kind == Token::Kind::IF)
90 std::cout << "if";
91 if (token->kind == Token::Kind::ELSE)
92 std::cout << "else";
93 if (token->kind == Token::Kind::WHILE)
94 std::cout << "while";
95 if (token->kind == Token::Kind::LBRACE)
96 std::cout << "{";
97 if (token->kind == Token::Kind::RBRACE)
98 std::cout << "}";
99 if (token->kind == Token::Kind::STM)
100 std::cout << "stm-" << ((StmToken *)token)->sstm;
101 if (token->kind == Token::Kind::COND)
102 std::cout << "cond-" << ((CondToken *)token)->cond;
103 if (token->kind == Token::Kind::END)
104 std::cout << "$" << std::endl;
105 std::cout << " (" << token->pos.first << ", " << token->pos.second << ")" << std::endl;
106 }
107}
108
109std::shared_ptr<IR::Stm> CodeParser::parse() {
110 std::vector<Token *> parseStack;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected