diff --git a/CMakeLists.txt b/CMakeLists.txt
index b77818e..e89e61d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,47 +2,49 @@ cmake_minimum_required(VERSION 2.8.3)
project(Blang)
-if(NOT INSTALL_RUNTIME_DIR)
- set(INSTALL_RUNTIME_DIR bin)
-endif()
+set(Blang_VERSION 1.0.0)
+set(Blang_RELEASE 1)
-if(NOT INSTALL_LIBRARY_DIR)
- set(INSTALL_LIBRARY_DIR bin)
-endif()
+if (NOT INSTALL_RUNTIME_DIR)
+ set(INSTALL_RUNTIME_DIR bin)
+endif ()
-if(NOT INSTALL_DATA_DIR)
- set(INSTALL_DATA_DIR share/blang)
-endif()
+if (NOT INSTALL_LIBRARY_DIR)
+ set(INSTALL_LIBRARY_DIR bin)
+endif ()
-if(NOT INSTALL_DOC_DIR)
- set(INSTALL_DOC_DIR doc/blang)
-endif()
+if (NOT INSTALL_DATA_DIR)
+ set(INSTALL_DATA_DIR share/blang)
+endif ()
-if(NOT INSTALL_CLIB_DIR)
- set(INSTALL_CLIB_DIR clib)
-endif()
+if (NOT INSTALL_DOC_DIR)
+ set(INSTALL_DOC_DIR doc/blang)
+endif ()
+
+if (NOT INSTALL_CLIB_DIR)
+ set(INSTALL_CLIB_DIR clib)
+endif ()
set(CMAKE_CXX_FLAGS "-std=c++11")
find_package(BISON REQUIRED)
find_package(FLEX REQUIRED)
-add_subdirectory(utils)
add_subdirectory(tools)
add_subdirectory(src)
option(BUILD_UNIT_TESTS "Build unit tests" OFF)
-if(BUILD_UNIT_TESTS)
- add_subdirectory(tests)
-endif()
+if (BUILD_UNIT_TESTS)
+ add_subdirectory(tests)
+endif ()
option(BUILD_DOC "Build documentation" OFF)
-if(BUILD_DOC)
- add_subdirectory(doc)
-endif()
+if (BUILD_DOC)
+ add_subdirectory(doc)
+endif ()
install(DIRECTORY share/blang/ DESTINATION "${INSTALL_DATA_DIR}")
install(DIRECTORY clib/ DESTINATION "${INSTALL_CLIB_DIR}")
-install(FILES "LICENSE" "NOTICE" DESTINATION "${INSTALL_DOC_DIR}" )
+install(FILES "LICENSE" "NOTICE" DESTINATION "${INSTALL_DOC_DIR}")
diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user
deleted file mode 100644
index 0c47ec8..0000000
--- a/CMakeLists.txt.user
+++ /dev/null
@@ -1,480 +0,0 @@
-
-
-
-
-
- EnvironmentId
- {3fb93d8a-9d4c-46aa-821b-80ac79602a86}
-
-
- ProjectExplorer.Project.ActiveTarget
- 0
-
-
- ProjectExplorer.Project.EditorSettings
-
- true
- false
- true
-
- Cpp
-
- CppGlobal
-
-
-
- QmlJS
-
- QmlJSGlobal
-
-
- 2
- UTF-8
- false
- 4
- false
- 80
- true
- true
- 1
- true
- false
- 0
- true
- true
- 0
- 8
- true
- 1
- true
- true
- true
- false
-
-
-
- ProjectExplorer.Project.PluginSettings
-
- true
-
-
-
- ProjectExplorer.Project.Target.0
-
- Desktop Qt 5.6.1 MinGW 32bit
- Desktop Qt 5.6.1 MinGW 32bit
- qt.56.win32_mingw49_kit
- 0
- 0
- 2
-
-
- CMAKE_CXX_COMPILER:FILEPATH=C:/Dev/mingw32/bin/g++.exe
-
- C:/Users/Yoann/Documents/Informatique/GitHub/Blang-build
-
-
-
-
- all
-
- true
- Make
-
- CMakeProjectManager.MakeStep
-
- 1
- Build
-
- ProjectExplorer.BuildSteps.Build
-
-
-
-
-
- clean
-
- true
- Make
-
- CMakeProjectManager.MakeStep
-
- 1
- Clean
-
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Default
- Default
- CMakeProjectManager.CMakeBuildConfiguration
-
- 1
-
-
- 0
- Deploy
-
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- Deploy locally
-
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- PreBlang
-
-
- C:/Users/Yoann/Documents/Informatique/GitHub/Blang-build/tools/PreBlang
- -1
-
- PreBlang
-
- CMakeProjectManager.CMakeRunConfiguration.PreBlang
- 3768
- false
- true
- false
- false
- true
-
-
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- Lex
-
-
- C:/Users/Yoann/Documents/Informatique/GitHub/Blang-build/tools/lex
- -1
-
- Lex
-
- CMakeProjectManager.CMakeRunConfiguration.Lex
- 3768
- false
- true
- false
- false
- true
-
-
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- Blang
-
-
- C:/Users/Yoann/Documents/Informatique/GitHub/Blang-build/src
- 2
-
- Blang
-
- CMakeProjectManager.CMakeRunConfiguration.Blang
- 3768
- false
- true
- false
- false
- true
-
-
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- LibBlangTests
-
-
- C:/Users/Yoann/Documents/Informatique/GitHub/Blang-build/unittests/libblang
- -1
-
- LibBlangTests (disabled)
-
- CMakeProjectManager.CMakeRunConfiguration.LibBlangTests
- 3768
- false
- true
- false
- false
- true
-
-
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- lexTest
-
-
- C:/Users/Yoann/Documents/Informatique/GitHub/Blang-build/unittests/lex
- -1
-
- lexTest (disabled)
-
- CMakeProjectManager.CMakeRunConfiguration.lexTest
- 3768
- false
- true
- false
- false
- true
-
-
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- MustacheTest
-
-
- C:/Users/Yoann/Documents/Informatique/GitHub/Blang-build/unittests/Mustache
- -1
-
- MustacheTest (disabled)
-
- CMakeProjectManager.CMakeRunConfiguration.MustacheTest
- 3768
- false
- true
- false
- false
- true
-
- 6
-
-
-
- ProjectExplorer.Project.TargetCount
- 1
-
-
- ProjectExplorer.Project.Updater.FileVersion
- 18
-
-
- Version
- 18
-
-
diff --git a/README.rst b/README.md
similarity index 52%
rename from README.rst
rename to README.md
index fb00744..ee1b403 100644
--- a/README.rst
+++ b/README.md
@@ -1,28 +1,14 @@
-G1M-assembler
-*******
+### G1M-assembler
-Introduction
-============
+## Introduction
-G1M-assembler is a Text-to-BasicCasio converter tools.
-Manual
-======
+Blang is a Text-to-BasicCasio converter tools.
-See the `mkg1m(1)`_ manual page for instructions to run the tool.
+## Build
-.. _`mkg1m(1)`: man/mkg1m.1
-License
-=======
-
-CastXML is licensed under the `GPL V3`_.
-See the ``__ and ``__ files for details.
-
-Build
-=====
-
-To build g1m-assembler tools from source, first obtain the prerequisites:
+To build Blang tools from source, first obtain the prerequisites:
* A C/C++ compiler
diff --git a/configure_lexer.py b/configure_lexer.py
deleted file mode 100644
index 0e94f01..0000000
--- a/configure_lexer.py
+++ /dev/null
@@ -1,3 +0,0 @@
-import json
-json_data = open('file')
-data = json.load(json_data)
\ No newline at end of file
diff --git a/src/.gitignore b/src/.gitignore
new file mode 100644
index 0000000..bfd3092
--- /dev/null
+++ b/src/.gitignore
@@ -0,0 +1,3 @@
+lib/src/Parser.cpp
+lib/parser_gen.cpp
+lib/src/Parser.h
\ No newline at end of file
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f9fac89..0a54b32 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,15 +1,11 @@
-include_directories(include)
+include_directories(lib/src)
set(LIBRARY_OUTPUT_PATH lib/${CMAKE_BUILD_TYPE})
-set(Blang_VERSION 1.0.0)
-set(Blang_RELEASE 1)
-configure_file(include/version.h.in include/version.h @ONLY)
-
-BISON_TARGET(BlangParser parser.y lib/parser_gen.cpp)
-FLEX_TARGET(BlangScanner lexer.l lib/lexer_gen.cpp)
-ADD_FLEX_BISON_DEPENDENCY(BlangScanner BlangParser)
+add_subdirectory(lib)
+add_subdirectory(ast)
+add_subdirectory(code-gen)
file(
GLOB_RECURSE
@@ -19,25 +15,8 @@ file(
add_executable(Blang ${sources_files})
-file(
- GLOB_RECURSE
- lib_files
- lib/*
-)
-
-add_library(
- libblang
- SHARED
- ${lib_files}
-)
-
target_link_libraries(
Blang
libblang
)
-target_link_libraries(
- libblang
- libpreblang
- blangutils
-)
diff --git a/src/ast/CMakeLists.txt b/src/ast/CMakeLists.txt
new file mode 100644
index 0000000..bc75591
--- /dev/null
+++ b/src/ast/CMakeLists.txt
@@ -0,0 +1,13 @@
+file(
+ GLOB_RECURSE
+ sources_files
+ src/*
+)
+
+add_executable(blang-ast ${sources_files})
+
+target_link_libraries(
+ blang-ast
+ libblang
+)
+
diff --git a/src/ast/src/main.cpp b/src/ast/src/main.cpp
new file mode 100644
index 0000000..380845f
--- /dev/null
+++ b/src/ast/src/main.cpp
@@ -0,0 +1,96 @@
+#include
+#include
+#include
+#include