Updating the changelog in the VERSION file, and version_sync.
[shapes.git] / source / astvalues.h
blob618f3c8aefb94539883dd777d31a3c6d325446ef
1 /* This file is part of Shapes.
3 * Shapes is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * any later version.
8 * Shapes is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with Shapes. If not, see <http://www.gnu.org/licenses/>.
16 * Copyright 2008 Henrik Tidefelt
19 #pragma once
21 #include "ast.h"
23 namespace Shapes
25 namespace Ast
28 class Constant : public Expression
30 Kernel::VariableHandle val_;
31 public:
32 Constant( const Ast::SourceLocation & loc, const Kernel::VariableHandle & val );
33 Constant( const Ast::SourceLocation & loc, RefCountPtr< const Lang::Value > val );
34 Constant( const Ast::SourceLocation & loc, const Lang::Value * val );
35 virtual ~Constant( );
36 virtual void analyze_impl( Ast::Node * parent, Ast::AnalysisEnvironment * env, Ast::StateIDSet * freeStatesDst );
37 virtual void eval( Kernel::EvalState * evalState ) const;
40 class PolarHandle2DExpr : public Expression
42 Ast::Expression * rExpr_;
43 Ast::Expression * aExpr_;
44 public:
45 PolarHandle2DExpr( const Ast::SourceLocation & loc, Ast::Expression * rExpr, Ast::Expression * aExpr );
46 virtual ~PolarHandle2DExpr( );
47 virtual void analyze_impl( Ast::Node * parent, Ast::AnalysisEnvironment * env, Ast::StateIDSet * freeStatesDst );
48 virtual void eval( Kernel::EvalState * evalState ) const;
51 class PolarHandle2DExprFree_a : public Expression
53 Ast::Expression * rExpr_;
54 public:
55 PolarHandle2DExprFree_a( const Ast::SourceLocation & loc, Ast::Expression * rExpr );
56 virtual ~PolarHandle2DExprFree_a( );
57 virtual void analyze_impl( Ast::Node * parent, Ast::AnalysisEnvironment * env, Ast::StateIDSet * freeStatesDst );
58 virtual void eval( Kernel::EvalState * evalState ) const;
61 /* This class really doesn't fit in any file, but here it is!
63 class EmptyExpression : public Expression
65 public:
66 EmptyExpression( const Ast::SourceLocation & loc );
67 virtual ~EmptyExpression( );
68 virtual void analyze_impl( Ast::Node * parent, Ast::AnalysisEnvironment * env, Ast::StateIDSet * freeStatesDst );
69 virtual void eval( Kernel::EvalState * evalState ) const;
74 namespace Kernel
77 class PolarHandle2DCont : public Kernel::Continuation
79 RefCountPtr< Kernel::PolarHandlePromise > rPromise_;
80 Kernel::ContRef cont_;
81 public:
82 PolarHandle2DCont( const Ast::SourceLocation & _traceLoc, const RefCountPtr< Kernel::PolarHandlePromise > & rPromise, const Kernel::ContRef & cont );
83 virtual ~PolarHandle2DCont( );
84 virtual void takeValue( const RefCountPtr< const Lang::Value > & val, Kernel::EvalState * evalState, bool dummy ) const;
85 virtual Kernel::ContRef up( ) const;
86 virtual RefCountPtr< const char > description( ) const;
87 virtual void gcMark( Kernel::GCMarkedSet & marked );