Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
abe91a64
Commit
abe91a64
authored
Feb 27, 2017
by
Patrick Dular
Browse files
Options
Downloads
Patches
Plain Diff
Struct type: size of scope
parent
8ef6dd06
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Parser/Gmsh.tab.cpp
+3089
-3066
3089 additions, 3066 deletions
Parser/Gmsh.tab.cpp
Parser/Gmsh.y
+16
-3
16 additions, 3 deletions
Parser/Gmsh.y
Parser/Gmsh.yy.cpp
+950
-937
950 additions, 937 deletions
Parser/Gmsh.yy.cpp
Parser/Parser.h
+1
-0
1 addition, 0 deletions
Parser/Parser.h
with
4056 additions
and
4006 deletions
Parser/Gmsh.tab.cpp
+
3089
−
3066
View file @
abe91a64
This diff is collapsed.
Click to expand it.
Parser/Gmsh.y
+
16
−
3
View file @
abe91a64
...
@@ -2216,7 +2216,7 @@ Transform :
...
@@ -2216,7 +2216,7 @@ Transform :
}
}
$$ = $8;
$$ = $8;
}
}
|
String__Index
'{' MultipleShape '}'
|
tSTRING
'{' MultipleShape '}'
{
{
$$ = List_Create(3, 3, sizeof(Shape));
$$ = List_Create(3, 3, sizeof(Shape));
std::string action($1);
std::string action($1);
...
@@ -4676,6 +4676,19 @@ FExpr_Single :
...
@@ -4676,6 +4676,19 @@ FExpr_Single :
}
}
Free($2);
Free($2);
}
}
| '#' String__Index tSCOPE
{
std::string struct_namespace($2);
$$ = (double)nameSpaces[struct_namespace].size();
Free($2);
}
| '#' tSCOPE
{
std::string struct_namespace(std::string(""));
$$ = (double)nameSpaces[struct_namespace].size();
}
| String__Index NumericIncrement
| String__Index NumericIncrement
{
{
if(!gmsh_yysymbols.count($1)){
if(!gmsh_yysymbols.count($1)){
...
@@ -4748,7 +4761,7 @@ FExpr_Single :
...
@@ -4748,7 +4761,7 @@ FExpr_Single :
//+++ ... extention to structures
//+++ ... extention to structures
// PD: TO FIX (to avoid shift/reduce conflict)
// PD: TO FIX (to avoid shift/reduce conflict)
// | Struct_FullName '.' tSTRING
//
_Member_Float
// | Struct_FullName '.' tSTRING_Member_Float
| String__Index '.' tSTRING_Member_Float
| String__Index '.' tSTRING_Member_Float
{
{
$$ = treat_Struct_FullName_dot_tSTRING_Float(NULL, $1, $3);
$$ = treat_Struct_FullName_dot_tSTRING_Float(NULL, $1, $3);
...
@@ -4877,7 +4890,7 @@ DefineStruct :
...
@@ -4877,7 +4890,7 @@ DefineStruct :
if (!nameSpaces[struct_namespace].count(struct_name)) {
if (!nameSpaces[struct_namespace].count(struct_name)) {
int index = (int)$6;
int index = (int)$6;
if (index < 0)
if (index < 0)
index = nameSpaces[struct_namespace].
get().
size()+1;
index = nameSpaces[struct_namespace].size()+1;
nameSpaces[struct_namespace][struct_name] =
nameSpaces[struct_namespace][struct_name] =
Struct(index, floatOptions, charOptions);
Struct(index, floatOptions, charOptions);
$$ = (double)index;
$$ = (double)index;
...
...
This diff is collapsed.
Click to expand it.
Parser/Gmsh.yy.cpp
+
950
−
937
View file @
abe91a64
This diff is collapsed.
Click to expand it.
Parser/Parser.h
+
1
−
0
View file @
abe91a64
...
@@ -73,6 +73,7 @@ public:
...
@@ -73,6 +73,7 @@ public:
inline
T
&
operator
[]
(
K
key
)
{
return
_map
[
key
];
}
inline
T
&
operator
[]
(
K
key
)
{
return
_map
[
key
];
}
inline
std
::
map
<
K
,
T
>
&
get
()
{
return
_map
;
}
inline
std
::
map
<
K
,
T
>
&
get
()
{
return
_map
;
}
inline
int
count
(
std
::
string
key
)
{
return
_map
.
count
(
key
);
}
inline
int
count
(
std
::
string
key
)
{
return
_map
.
count
(
key
);
}
inline
int
size
()
{
return
_map
.
size
();
}
public
:
public
:
std
::
map
<
K
,
T
>
_map
;
std
::
map
<
K
,
T
>
_map
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment