Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CTA-LAPP
PHOENIX_LIBS
ParserGenerator
Commits
d69839e7
Commit
d69839e7
authored
Jan 13, 2021
by
Pierre Aubert
Browse files
Need to finalize gobal variable parsing and use
parent
c0e17708
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
src/GraphParser/PGraphParser.cpp
src/GraphParser/PGraphParser.cpp
+14
-0
No files found.
src/GraphParser/PGraphParser.cpp
View file @
d69839e7
...
...
@@ -352,6 +352,9 @@ bool PGraphParser::parseVector(){
type
+=
")"
;
}
std
::
string
name
(
getStrComposedOf
(
p_charsetName
));
//We can imagine an initialisation such as = [value, value, value] or [[value, value], [value, value]] etc
if
(
!
checkExprectedMatch
(
";"
,
name
))
return
false
;
PVarToken
vecToken
;
...
...
@@ -371,6 +374,8 @@ bool PGraphParser::parseGlobalVar(){
if
(
matchCurrentToken
==
""
){
return
false
;}
std
::
string
type
(
getStrComposedOf
(
p_charsetName
));
std
::
string
name
(
getStrComposedOf
(
p_charsetName
));
//We can imagine an intialisation such as '= value' or '="string"'
if
(
!
checkExprectedMatch
(
";"
,
name
))
return
false
;
PVarToken
var
;
var
.
setNbVector
(
0lu
);
...
...
@@ -401,11 +406,20 @@ bool PGraphParser::parseGlobalVarUse(){
if
(
currentVar
->
getNbVector
()
==
0lu
){
//Put a parsed value in the variable
//Look for a =
//And then put the value/string in the variable
}
else
{
//Check if the push_back function is called and generated this function call in the InitialisationFunction
//of the parser
//Look for a '='
//Look for a '.' then 'pushBack(value)', 'front()', 'back()', '[index]', 'clear()', 'concatenate(value, value, value, value)'
}
//Then expect a ;
return
true
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment