NodeDef
| 1797 | |
| 1798 | // NodeDef |
| 1799 | NodeDef::NodeDef(const token_vector &expr, uint32_t line) |
| 1800 | : NodeParent(line) |
| 1801 | { |
| 1802 | TokenIterator tok(expr); |
| 1803 | tok.match(token_type_t::DEF_TOKEN, "expected 'def'"); |
| 1804 | |
| 1805 | m_name = tok.match(token_type_t::KEY_PATH_TOKEN, "expected key path")->get_value(); |
| 1806 | |
| 1807 | if (tok->get_type() == token_type_t::OPEN_PAREN_TOKEN) |
| 1808 | { |
| 1809 | tok.match(token_type_t::OPEN_PAREN_TOKEN); |
| 1810 | |
| 1811 | while (tok->get_type() != token_type_t::CLOSE_PAREN_TOKEN) |
| 1812 | { |
| 1813 | m_params.push_back(tok.match(token_type_t::KEY_PATH_TOKEN, "expected key path")->get_value()); |
| 1814 | |
| 1815 | if (tok->get_type() != token_type_t::CLOSE_PAREN_TOKEN) |
| 1816 | { |
| 1817 | tok.match(token_type_t::COMMA_TOKEN, "expected comma"); |
| 1818 | } |
| 1819 | } |
| 1820 | tok.match(token_type_t::CLOSE_PAREN_TOKEN, "expected close paren"); |
| 1821 | } |
| 1822 | tok.match(token_type_t::END_TOKEN, "expected end of statement"); |
| 1823 | } |
| 1824 | |
| 1825 | NodeType NodeDef::gettype() |
| 1826 | { |