Created
January 1, 2023 02:05
-
-
Save queercat/b98bc5401dcf9e8cee1ccdb5e02e7de6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <vector> | |
| enum NODE_TYPE { | |
| OBJECT_NODE, | |
| PROPERTY_NODE, | |
| ARRAY_NODE, | |
| LITERAL_NODE, | |
| NULL_NODE, | |
| STRING_NODE, | |
| }; | |
| class Node { | |
| public: | |
| NODE_TYPE type; | |
| }; | |
| class ObjectNode: Node { | |
| public: | |
| ObjectNode() { | |
| type = NODE_TYPE::OBJECT_NODE; | |
| } | |
| }; | |
| class ArrayNode: Node { | |
| public: | |
| ArrayNode() { | |
| type = NODE_TYPE::ARRAY_NODE; | |
| } | |
| }; | |
| class NullNode: Node { | |
| public: | |
| NullNode() { | |
| type = NODE_TYPE::NULL_NODE; | |
| } | |
| }; | |
| class StringNode: Node { | |
| public: | |
| StringNode() { | |
| type = NODE_TYPE::STRING_NODE; | |
| } | |
| string value; | |
| }; | |
| class BoolNode: Node { | |
| public: | |
| BoolNode() { | |
| type = NODE_TYPE::BOOL_NODE; | |
| } | |
| } | |
| class NumberNode: Node { | |
| public: | |
| NumberNode() { | |
| type = NODE_TYPE::NumberNode; | |
| } | |
| } | |
| class PropertyNode: Node { | |
| public: | |
| PropertyNode() { | |
| type = NODE_TYPE::PROPERTY_NODE; | |
| } | |
| Node* value; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment