From c55766129dbd0a0e67387945cc0743482c1674cc Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (l)" <j.wuttke@fz-juelich.de> Date: Thu, 15 Oct 2015 08:39:11 +0200 Subject: [PATCH] cleanup --- pub/lib/node.hpp | 54 ++++++++++++++++++++++---------------------- pub/lib/xax_yacc.ypp | 4 ++-- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pub/lib/node.hpp b/pub/lib/node.hpp index c568d1b7..8d3729e4 100644 --- a/pub/lib/node.hpp +++ b/pub/lib/node.hpp @@ -148,33 +148,6 @@ class CNodeVal: public CNode { }; -//! Indexed variable node. - -class CNodeIva: public CNode { - private: - RVar var; - RRef ref; - void npar_exec( int *np ) const; - public: - CNodeIva( RVar _var, RRef _ref=RRef( new CRef() ) ) : var(_var), ref(_ref) {} - const RObj tree_val( const CContext& ctx ) const; - void kdep_exec( bool *kd ) const { *kd = true; } - void set_coord( CCoord& ret, int k ) const; - string tree_info() const; -}; - - -//! Indexed variable node. - -class CNodeSessionNK: public CNode { - public: - const RObj tree_val( const CContext& ctx ) const; - void kdep_exec( bool *kd ) const { *kd = false; } - void set_coord( CCoord& ret, int k ) const { ret = CCoord("nk", ""); } - string tree_info() const { return "nk {number of online files}"; } -}; - - //! Index node base class. class CNodeIdx: public CNode { @@ -213,6 +186,33 @@ class CNodeIdxK: public CNodeIdx { }; +//! Session-wide workspace information: NK = number of online files. + +class CNodeSessionNK: public CNode { + public: + const RObj tree_val( const CContext& ctx ) const; + void kdep_exec( bool *kd ) const { *kd = false; } + void set_coord( CCoord& ret, int k ) const { ret = CCoord("nk", ""); } + string tree_info() const { return "nk {number of online files}"; } +}; + + +//! Indexed variable node. + +class CNodeIva: public CNode { + private: + RVar var; + RRef ref; + void npar_exec( int *np ) const; + public: + CNodeIva( RVar _var, RRef _ref=RRef( new CRef() ) ) : var(_var), ref(_ref) {} + const RObj tree_val( const CContext& ctx ) const; + void kdep_exec( bool *kd ) const { *kd = true; } + void set_coord( CCoord& ret, int k ) const; + string tree_info() const; +}; + + //! Identifier node. class CNodeIdf: public CNode { diff --git a/pub/lib/xax_yacc.ypp b/pub/lib/xax_yacc.ypp index 61de1bdc..b813ed0a 100644 --- a/pub/lib/xax_yacc.ypp +++ b/pub/lib/xax_yacc.ypp @@ -104,7 +104,7 @@ range: exp: /* scalar expression */ VAL { $$.t = $1.t; } - | REF bra3 { $$.t = RNode( new CNodeIva( $1.v, $2.r ) ); } + | REF bra3 { $$.t = RNode( new CNodeIva( $1.v, $2.r ) ); } | IDF { $$.t = RNode( new CNodeIdf( (PCAST<const CObjStr>($1.o))->to_s() ) ); } | DUMMY { $$.t = RNode( new CNodeDummy() ); } | CEV bra2 '(' exp ')' { $$.t = RNode( new CNodeCev( $2.r, $4.t ) ); } @@ -121,7 +121,7 @@ exp: /* scalar expression */ $$.t = RNode( new CNodeFun2( (const CFunc*) $1.p, $3.t, $5.t ) ); } | FNCT '(' exp ',' exp ',' exp ')' { $$.t = RNode( new CNodeFun3((const CFunc*) $1.p, $3.t, $5.t, $7.t) );} - | GENI bra2 { $$.t = RNode( new CNodeGeni( (const CGeni*) $1.p, $2.r) ); } + | GENI bra2 { $$.t = RNode( new CNodeGeni( (const CGeni*) $1.p, $2.r) ); } | GENI '(' exp ')' { $$.t = RNode( new CNodeGeni( (const CGeni*) $1.p, $3.t) ); } | GENI '(' exp ',' exp ')' { $$.t = RNode( new CNodeGeni( (const CGeni*) $1.p, $3.t, $5.t) ); } -- GitLab