Commit MetaInfo

Revisión92425081dc403e117162a474484cae0a7eece6d9 (tree)
Tiempo2013-02-25 06:26:06
Autorttwilb <someone@exam...>
Commiterttwilb

Log Message

t

Cambiar Resumen

Diferencia incremental

--- /dev/null
+++ b/Definition.cpp
@@ -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+
--- a/Namespace.cpp
+++ /dev/null
@@ -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-
--- a/common_cpp.h
+++ b/common_cpp.h
@@ -44,14 +44,9 @@ private:
4444 };
4545
4646
47-/*** Namespace.cpp ***/
47+/*** error.cpp ***/
4848
49-class Namespace
50-{
51-public:
52- Namespace(void);
53- ~Namespace(void);
54-};
49+void show_err(char* msg);
5550
5651
5752 /*** Tokenizer.cpp ***/
@@ -60,5 +55,12 @@ class Tokenizer
6055 {
6156 public:
6257 Tokenizer(Stream st);
63- ~Tokenizer(void);
58+ bool isNull();
59+};
60+
61+
62+/*** Definition ***/
63+
64+class Definition
65+{
6466 };
--- a/compile.cpp
+++ b/compile.cpp
@@ -9,7 +9,22 @@
99 *
1010 */
1111
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)
1328 {
1429
1530 }
--- /dev/null
+++ b/error.cpp
@@ -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+}
Show on old repository browser