Revisión | 92425081dc403e117162a474484cae0a7eece6d9 (tree) |
---|---|
Tiempo | 2013-02-25 06:26:06 |
Autor | ttwilb <someone@exam...> |
Commiter | ttwilb |
t
@@ -0,0 +1,13 @@ | ||
1 | +#include "common_cpp.h" | |
2 | + | |
3 | +/* | |
4 | +* Definition.cpp --compile tokens | |
5 | +* | |
6 | +* Copyright(C) 2013(Heisei 25) ttwilb All rights reserved. | |
7 | +* | |
8 | +* This source code is released on the BSD licensing. | |
9 | +* | |
10 | +*/ | |
11 | + | |
12 | + | |
13 | + |
@@ -1,17 +0,0 @@ | ||
1 | -#include "common_cpp.h" | |
2 | - | |
3 | -/*** class Namespace ***/ | |
4 | - | |
5 | -Namespace::Namespace(string path) | |
6 | -{ | |
7 | -} | |
8 | - | |
9 | - | |
10 | -Namespace::~Namespace(void) | |
11 | -{ | |
12 | -} | |
13 | - | |
14 | - | |
15 | -/*** class NamespaceManager ***/ | |
16 | - | |
17 | - |
@@ -44,14 +44,9 @@ private: | ||
44 | 44 | }; |
45 | 45 | |
46 | 46 | |
47 | -/*** Namespace.cpp ***/ | |
47 | +/*** error.cpp ***/ | |
48 | 48 | |
49 | -class Namespace | |
50 | -{ | |
51 | -public: | |
52 | - Namespace(void); | |
53 | - ~Namespace(void); | |
54 | -}; | |
49 | +void show_err(char* msg); | |
55 | 50 | |
56 | 51 | |
57 | 52 | /*** Tokenizer.cpp ***/ |
@@ -60,5 +55,12 @@ class Tokenizer | ||
60 | 55 | { |
61 | 56 | public: |
62 | 57 | Tokenizer(Stream st); |
63 | - ~Tokenizer(void); | |
58 | + bool isNull(); | |
59 | +}; | |
60 | + | |
61 | + | |
62 | +/*** Definition ***/ | |
63 | + | |
64 | +class Definition | |
65 | +{ | |
64 | 66 | }; |
@@ -9,7 +9,22 @@ | ||
9 | 9 | * |
10 | 10 | */ |
11 | 11 | |
12 | -void compile_onefile(Tokenizer tkns) | |
12 | +int compile_onefile(Tokenizer tkns) | |
13 | +{ | |
14 | + Definition def = compile_definition(tkns); | |
15 | + | |
16 | + if(!tkns.isNull()) | |
17 | + { | |
18 | + //err: too many '}' token and the tree structure was destroyed. | |
19 | + show_err("Too many '}' tokens"); | |
20 | + | |
21 | + }else | |
22 | + { | |
23 | + //TODO: register def to the default namespace (with good definition name) | |
24 | + } | |
25 | +} | |
26 | + | |
27 | +Definition compile_definition(Tokenizer tkns) | |
13 | 28 | { |
14 | 29 | |
15 | 30 | } |
@@ -0,0 +1,15 @@ | ||
1 | +#include "common_cpp.h" | |
2 | + | |
3 | +/* | |
4 | +* error.cpp --show errors | |
5 | +* | |
6 | +* Copyright(C) 2013(Heisei 25) ttwilb All rights reserved. | |
7 | +* | |
8 | +* This source code is released on the BSD licensing. | |
9 | +* | |
10 | +*/ | |
11 | + | |
12 | +void show_err(char* msg) | |
13 | +{ | |
14 | + cout << "ERROR: " << msg << endl; | |
15 | +} |