38 #include <readline/readline.h>
39 #include <readline/history.h>
43 #define INTERPRETER_NAME "omi"
44 #define INTERPRETER_DESCRIPTION "Open Modular Interpreter"
45 #define INTERPRETER_VERSION "0.1"
46 #define INTERPRETER_LICENSE "GNU General Public License version 2"
47 #define HISTORY_FILE string(getenv("HOME")) + "/." + string(INTERPRETER_NAME) + "_history"
48 #define PS1 INTERPRETER_NAME + string(" |> ")
49 #define PS2 INTERPRETER_NAME + string(" {> ")
50 #define PS2_BRACKET INTERPRETER_NAME + string(" (> ")
54 extern bool inline_param;
79 void scan_string(
const char* str);
88 static string omi (
string str, vector<string>args);
111 ofstream json_stream;
116 unsigned int steps_count;
117 static void jsonInit();
118 static void to_json(
string value,
string end =
"");
119 static void to_jsonRun (
runNode * r,
string msg =
"");
120 static void to_jsonRunClass (
runNode * r);
121 static void to_jsonEndClass (
runNode * r);
124 static void to_jsonSetValue (
runNode *r,
bool val);
125 static void to_jsonSetValue (
runNode *r,
string val);
126 static void to_jsonSetValue (
runNode *r, num val);
129 static void to_jsonSleep (
runNode *r,
int seg);
130 static void to_jsonNewNode (
runNode *node,
bool implicit =
false);
131 static void to_jsonError (
string error);
132 static void to_jsonRemoveLevel (
unsigned int level);
136 static void to_jsonClone (
runNode * elem,
runNode * of,
string name,
string type);
138 static void to_jsonChangeValue (
runNode* node,
string val);
139 static void to_jsonDelete (
runNode * elem);
140 static void to_jsonOut (
runNode * elem,
string out);
141 static void to_jsonRunStatic (
runNode * elem);
142 static void to_jsonEndStatic (
runNode * elem);
143 static void to_jsonRunPrivate (
runNode * elem);
144 static void to_jsonEndPrivate (
runNode * elem);
145 static void to_jsonRunGlobal (
runNode * elem);
146 static void to_jsonEndGlobal (
runNode * elem);
147 static string to_jsonInput (
runNode * elem);
149 static void jsonEnd(
string error =
"");
159 void generateClass ();
160 void parseOptions (
int argc,
char *argv[]);
166 void printVersion ();
167 void loadModule (
string module);
170 vector<string> args_;
173 bool inl_, error_opt_;
Nodo ejecutable.
Definition: runTree.h:123
Contexto de tablas de símbolos.
Definition: sTable.h:121
Interprete OMI.
Definition: interpreter.h:68
static interpreter * init(int argc, char *argv[])
Definition: interpreter.h:96