diff --git a/pub/lib/node.hpp b/pub/lib/node.hpp index c568d1b763ab49eaa555e5c9d820910052040850..8d3729e4b00299c7d27cad63e55d293e7a81316c 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 61de1bdc0ed33bac3471c2b00cb3c6523726faef..b813ed0a5a1974ebbfc4faf7d6ee899268835edf 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) ); }