Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Frida
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coenen, Joachim
Frida
Commits
0c5f4dad
Commit
0c5f4dad
authored
8 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
New command dv to display list of defined variables
parent
b1f0ee3d
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
pub/CHANGELOG
+4
-0
4 additions, 0 deletions
pub/CHANGELOG
pub/lib/commands.cpp
+19
-15
19 additions, 15 deletions
pub/lib/commands.cpp
pub/lib/variables.cpp
+14
-26
14 additions, 26 deletions
pub/lib/variables.cpp
pub/lib/variables.hpp
+6
-6
6 additions, 6 deletions
pub/lib/variables.hpp
with
43 additions
and
47 deletions
pub/CHANGELOG
+
4
−
0
View file @
0c5f4dad
- New command dv to display list of defined variables
- Experimental code for 2d plots
Release 2.3.6b of 14mar17:
- Replaced experimental/filesystem by boost/filesystem for compilation under gcc4.8
...
...
This diff is collapsed.
Click to expand it.
pub/lib/commands.cpp
+
19
−
15
View file @
0c5f4dad
...
...
@@ -39,6 +39,7 @@
#include
"reduce_spec.hpp"
#include
"rssm.hpp"
#include
"special.hpp"
#include
"variables.hpp"
#include
"commands.hpp"
...
...
@@ -211,28 +212,31 @@ bool frida_command(string cmd)
}
else
if
(
cmd
==
"d"
)
{
cout
<<
"Directory commands: inspect internal files
\n
"
" df list of files
\n
"
" dz z-values and spectral ranges
\n
"
" dp x|y-values
\n
"
" dy y-values
\n
"
" dr real parameters
\n
"
" dc coordinate names and units
\n
"
" dd doc lines
\n
"
;
" dc coordinate names and units
\n
"
" dd doc lines
\n
"
" df list of files
\n
"
" dp x|y-values
\n
"
" dr real parameters
\n
"
" dv variables
\n
"
" dy y-values
\n
"
" dz z-values and spectral ranges
\n
"
;
}
else
if
(
cmd
==
"dc"
)
{
NEdif
::
show_coord
();
}
else
if
(
cmd
==
"dd"
)
{
NEdif
::
show_doc
();
}
else
if
(
cmd
==
"df"
)
{
NEdif
::
show_files
();
}
else
if
(
cmd
==
"dz"
)
{
NEdif
::
show_spectra
();
}
else
if
(
cmd
==
"dp"
)
{
NOperate
::
show
(
"xyd"
);
}
else
if
(
cmd
==
"dy"
)
{
NOperate
::
show
(
"y"
);
}
else
if
(
cmd
==
"dr"
)
{
NEdif
::
show_numpars
();
}
else
if
(
cmd
==
"dc"
)
{
NEdif
::
show_coord
();
}
else
if
(
cmd
==
"dd"
)
{
NEdif
::
show_doc
();
}
else
if
(
cmd
==
"dv"
)
{
SVariRegistry
::
instance
()
->
display_all
();
}
else
if
(
cmd
==
"dy"
)
{
NOperate
::
show
(
"y"
);
}
else
if
(
cmd
==
"dz"
)
{
NEdif
::
show_spectra
();
}
else
if
(
cmd
==
"e"
)
{
cout
<<
"Edit commands:
\n
"
...
...
This diff is collapsed.
Click to expand it.
pub/lib/variables.cpp
+
14
−
26
View file @
0c5f4dad
...
...
@@ -7,18 +7,21 @@
//! \file variables.cpp
//! \brief Implements class SVariRegistry.
#include
<algorithm>
#include
"variables.hpp"
#include
"defs.hpp"
#include
"obj.hpp"
#include
"ptr.hpp"
PObj
SVariRegistry
::
find
(
string
key
)
const
PObj
SVariRegistry
::
find
(
const
string
&
key
)
const
{
auto
pos
=
Map
.
find
(
key
);
return
pos
==
Map
.
end
()
?
nullptr
:
pos
->
second
;
}
PObj
SVariRegistry
::
find_or_fail
(
string
key
)
const
PObj
SVariRegistry
::
find_or_fail
(
const
string
&
key
)
const
{
PObj
ret
=
find
(
key
);
if
(
!
ret
)
...
...
@@ -27,36 +30,21 @@ PObj SVariRegistry::find_or_fail(string key) const
}
void
SVariRegistry
::
display_
functions
()
const
void
SVariRegistry
::
display_
all
()
const
{
/*
// this implementation works only, if flist is strictly ordered:
// first operators by precedence, then functions.
cout << "Operators by precedence:\n";
int precedence = -1;
for( int i=0; i<FList.size(); ++i ){
const CFunc *f;
f = FList[i];
if( f->precedence ) { // operators
if( f->precedence!=precedence )
cout << "\n ";
cout << " " << f->key;
} else { // functions
if( f->precedence!=precedence )
cout << "\nBuilt-in functions:\n";
cout << " " << f->key << f->explanation << "\n";
}
precedence = f->precedence;
}
*/
vector
<
string
>
keys
;
for
(
const
auto
&
it
:
Map
)
keys
.
push_back
(
it
.
first
);
sort
(
keys
.
begin
(),
keys
.
end
());
for
(
const
string
&
key
:
keys
)
cout
<<
" "
<<
key
<<
" = "
<<
Map
.
at
(
key
)
->
to_s
()
<<
"
\n
"
;
}
void
SVariRegistry
::
register_scalar
(
string
key
,
PObj
val
)
{
Map
[
key
]
=
val
;
}
void
SVariRegistry
::
register_scalar
(
const
string
&
key
,
PObj
val
)
{
Map
[
key
]
=
val
;
}
//! Undefines a key (removes entry from registry); returns true unless the key wasn't defined.
bool
SVariRegistry
::
undef
(
string
key
)
bool
SVariRegistry
::
undef
(
const
string
&
key
)
{
auto
pos
=
Map
.
find
(
key
);
if
(
pos
==
Map
.
end
())
...
...
This diff is collapsed.
Click to expand it.
pub/lib/variables.hpp
+
6
−
6
View file @
0c5f4dad
...
...
@@ -20,16 +20,16 @@
class
SVariRegistry
:
public
triv
::
ISingleton
<
SVariRegistry
>
{
private:
map
<
string
,
PObj
>
Map
;
//! unsorted hash, for expression evaluation
map
<
const
string
,
PObj
>
Map
;
//! unsorted hash, for expression evaluation
public:
PObj
find
(
string
key
)
const
;
PObj
find_or_fail
(
string
key
)
const
;
PObj
find
(
const
string
&
key
)
const
;
PObj
find_or_fail
(
const
string
&
key
)
const
;
void
display_
functions
()
const
;
void
display_
all
()
const
;
void
register_scalar
(
string
key
,
PObj
val
);
bool
undef
(
string
key
);
void
register_scalar
(
const
string
&
key
,
PObj
val
);
bool
undef
(
const
string
&
key
);
};
#endif // VARIABLES_H
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