FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Shell-Development-Project/parser.cpp at mycode · Shell-Development-Project/Shell-Development-Project · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
Shell-Development-Project
/
Shell-Development-Project
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
2
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Shell-Development-Project
/
parser.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
51 lines (48 loc) · 1.3 KB
Breadcrumbs
Shell-Development-Project
/
parser.cpp
Copy path
File metadata and controls
51 lines (48 loc) · 1.3 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
include
<
iostream
>
#
include
<
vector
>
#
include
<
string
>
#
include
<
map
>
#
include
<
algorithm
>
#
include
<
stdio.h
>
#
include
<
string.h
>
#
include
<
math.h
>
#
include
<
stdlib.h
>
#
include
<
unistd.h
>
#
include
<
boost/filesystem.hpp
>
//
-lboost_system: Write this while compiling, this prevents
//
the linker error.
#
include
<
boost/algorithm/string/replace.hpp
>
#
include
"
lexical.h
"
#
include
"
syntax.h
"
#
include
"
processctrl.h
"
int
cmdSyntaxAnalysis
(string cmd)
{
std::vector <std::string> tokenStream;
std::vector <
char
*> tokens;
std::unordered_map <key, value> table;
int
flag;
int
whichTypeofExecution =
0
;
int
pipeCount =
0
;
cmdLexicalAnalysis
(cmd, tokenStream, tokens, pipeCount);
constructTable
(table);
if
(! tokenStream.
empty
())
tokenStream.
push_back
(
"
<$>
"
);
//
tokenStream.push_back("<string>");
//
tokenStream.push_back("<string>");
//
tokenStream.push_back("<string>");
//
tokenStream.push_back("<string>");
//
tokenStream.push_back("<unix_command>");
flag =
parser
(table, tokenStream);
if
(flag ==
1
)
{
try
{
processctrl
(cmd, tokens, pipeCount, whichTypeofExecution);
//
processctrl(cmd, tokens);
}
catch
(
int
x)
{
std::cout <<
"
Maybe memory is not available for one more process...:-(
"
<< std::endl;
}
}
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL