Skip to content

Commit abd2214

Browse files
committed
change the dir for the parser to be parser_gui to make the parser_cli
1 parent 4e247c5 commit abd2214

36 files changed

+1500
-0
lines changed

parser_gui/.gitignore

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
# This file is used to ignore files which are generated
2+
# ----------------------------------------------------------------------------
3+
4+
# Compiled Object files
5+
*.o
6+
*.obj
7+
8+
# Precompiled Header files
9+
*.gch
10+
*.pch
11+
12+
# Compiled Dynamic libraries
13+
*.so
14+
*.dylib
15+
*.dll
16+
17+
# Compiled Static libraries
18+
*.a
19+
*.lib
20+
21+
# Executable files
22+
scanner
23+
*.exe
24+
*.out
25+
26+
# Debug files
27+
*.dSYM/
28+
*.stackdump
29+
30+
# Temporary files and backups
31+
*.tmp
32+
*.swp
33+
*.bak
34+
*.log
35+
36+
# OS generated files
37+
.DS_Store
38+
Thumbs.db
39+
40+
# C++ cache files and directories
41+
*.cache
42+
.cache/
43+
*.ccache
44+
.ccache/
45+
46+
# Visual Studio Code workspace settings
47+
.vscode/
48+
*.code-workspace
49+
50+
# CLion and JetBrains IDE files
51+
.idea/
52+
cmake-build-*/
53+
54+
# Ignore binary and debug folders
55+
bin/
56+
debug/
57+
release/
58+
build/
59+
60+
# Compiled Object files
61+
*.o
62+
*.obj
63+
64+
# Precompiled Header files
65+
*.gch
66+
*.pch
67+
68+
# Compiled Dynamic libraries
69+
*.so
70+
*.dylib
71+
*.dll
72+
73+
# Compiled Static libraries
74+
*.a
75+
*.lib
76+
77+
# Executable files
78+
scanner
79+
*.exe
80+
*.out
81+
82+
# Debug files
83+
*.dSYM/
84+
*.stackdump
85+
86+
# Temporary files and backups
87+
*.tmp
88+
*.swp
89+
*.bak
90+
*.log
91+
92+
# OS generated files
93+
.DS_Store
94+
Thumbs.db
95+
96+
# C++ cache files and directories
97+
*.cache
98+
.cache/
99+
*.ccache
100+
.ccache/
101+
102+
# Visual Studio Code workspace settings
103+
.vscode/
104+
*.code-workspace
105+
106+
# CLion and JetBrains IDE files
107+
.idea/
108+
cmake-build-*/
109+
110+
# Ignore binary and debug folders
111+
bin/
112+
debug/
113+
release/
114+
115+
# Qt-specific files
116+
*.pro.user
117+
*.qmake.stash
118+
Makefile*
119+
*.moc
120+
*.rcc
121+
*.qrc.dep
122+
*.qmlc
123+
*.qmltypes
124+
ui_*.h
125+
126+
# CMake-generated files
127+
CMakeCache.txt
128+
CMakeFiles/
129+
cmake_install.cmake
130+
CTestTestfile.cmake
131+
Makefile
132+
133+
*~
134+
*.autosave
135+
*.a
136+
*.core
137+
*.moc
138+
*.o
139+
*.obj
140+
*.orig
141+
*.rej
142+
*.so
143+
*.so.*
144+
*_pch.h.cpp
145+
*_resource.rc
146+
*.qm
147+
.#*
148+
*.*#
149+
core
150+
!core/
151+
tags
152+
.DS_Store
153+
.directory
154+
*.debug
155+
Makefile*
156+
*.prl
157+
*.app
158+
moc_*.cpp
159+
ui_*.h
160+
qrc_*.cpp
161+
Thumbs.db
162+
*.res
163+
*.rc
164+
/.qmake.cache
165+
/.qmake.stash
166+
167+
# qtcreator generated files
168+
*.pro.user*
169+
CMakeLists.txt.user*
170+
171+
# xemacs temporary files
172+
*.flc
173+
174+
# Vim temporary files
175+
.*.swp
176+
177+
# Visual Studio generated files
178+
*.ib_pdb_index
179+
*.idb
180+
*.ilk
181+
*.pdb
182+
*.sln
183+
*.suo
184+
*.vcproj
185+
*vcproj.*.*.user
186+
*.ncb
187+
*.sdf
188+
*.opensdf
189+
*.vcxproj
190+
*vcxproj.*
191+
192+
# MinGW generated files
193+
*.Debug
194+
*.Release
195+
196+
# Python byte code
197+
*.pyc
198+
199+
# Binaries
200+
# --------
201+
*.dll
202+
*.exe
203+

parser_gui/CMakeLists.txt

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
3+
project(parser VERSION 0.1 LANGUAGES CXX)
4+
5+
set(CMAKE_AUTOUIC ON)
6+
set(CMAKE_AUTOMOC ON)
7+
set(CMAKE_AUTORCC ON)
8+
9+
set(CMAKE_CXX_STANDARD 17)
10+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
11+
12+
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
13+
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
14+
15+
# Specify the root directory
16+
set(ROOT_DIR ${CMAKE_SOURCE_DIR})
17+
18+
# Collect source files and header files dynamically for each module
19+
file(GLOB Parser_SRC
20+
"${ROOT_DIR}/Parser/src/*.cpp"
21+
"${ROOT_DIR}/Parser/include/*.h"
22+
)
23+
24+
file(GLOB Scanner_SRC
25+
"${ROOT_DIR}/Scanner/src/*.cpp"
26+
"${ROOT_DIR}/Scanner/include/*.h"
27+
)
28+
29+
file(GLOB Data_SRC
30+
"${ROOT_DIR}/Data/src/*.cpp"
31+
"${ROOT_DIR}/Data/include/*.h"
32+
)
33+
34+
file(GLOB FileHandling_SRC
35+
"${ROOT_DIR}/FileHandling/src/*.cpp"
36+
"${ROOT_DIR}/FileHandling/include/*.h"
37+
)
38+
39+
file(GLOB Widgets_SRC
40+
"${ROOT_DIR}/Widgets/src/*.cpp"
41+
"${ROOT_DIR}/Widgets/include/*.h"
42+
)
43+
44+
set(Widgets
45+
MainWindow.cpp MainWindow.h
46+
${Widgets_SRC}
47+
)
48+
49+
set(Parser
50+
${Parser_SRC}
51+
)
52+
53+
set(Scanner
54+
${Scanner_SRC}
55+
)
56+
57+
set(Data
58+
${Data_SRC}
59+
)
60+
61+
set(FileHandling
62+
${FileHandling_SRC}
63+
)
64+
65+
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
66+
qt_add_executable(parser
67+
MANUAL_FINALIZATION
68+
main.cpp
69+
${Widgets}
70+
${Parser}
71+
${Scanner}
72+
${Data}
73+
${FileHandling}
74+
resources.qrc
75+
)
76+
endif()
77+
78+
79+
# Include directories for headers
80+
include_directories(
81+
${ROOT_DIR}/Parser/include
82+
${ROOT_DIR}/Scanner/include
83+
${ROOT_DIR}/Data/include
84+
${ROOT_DIR}/FileHandling/include
85+
${ROOT_DIR}/Widgets/include
86+
)
87+
88+
target_link_libraries(parser PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
89+
90+
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
91+
# If you are developing for iOS or macOS you should consider setting an
92+
# explicit, fixed bundle identifier manually though.
93+
if(${QT_VERSION} VERSION_LESS 6.1.0)
94+
set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER com.example.parser)
95+
endif()
96+
set_target_properties(parser PROPERTIES
97+
${BUNDLE_ID_OPTION}
98+
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
99+
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
100+
MACOSX_BUNDLE TRUE
101+
WIN32_EXECUTABLE TRUE
102+
)
103+
104+
include(GNUInstallDirs)
105+
install(TARGETS parser
106+
BUNDLE DESTINATION .
107+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
108+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
109+
)
110+
111+
if(QT_VERSION_MAJOR EQUAL 6)
112+
qt_finalize_executable(parser)
113+
endif()

parser_gui/Data/include/ParseTree.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Parse Tree class
2+
3+
#ifndef PARSE_TREE_H
4+
#define PARSE_TREE_H
5+
6+
namespace Tiny::Data {
7+
8+
} // namespace Tiny::Data
9+
10+
#endif // PARSE_TREE_H

0 commit comments

Comments
 (0)