Namespace documentation: Private namespaces and detailed look-up rules
[shapes.git] / source / astflow.h
blobbf3e3b9a5beda37bb9db5f56111369bc805f9afd
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
26 namespace Ast
28 /* class IfExpr : public Expression */
29 /* { */
30 /* Ast::SourceLocation loc_; */
31 /* Expression * predicate_; */
32 /* Expression * consequence_; */
33 /* Expression * alternative_; */
34 /* public: */
35 /* IfExpr( const Ast::SourceLocation & loc, Expression * predicate, Expression * consequence, Expression * alternative ); */
36 /* IfExpr( const Ast::SourceLocation & loc, Expression * predicate, Expression * consequence ); */
37 /* virtual ~IfExpr( ); */
38 /* virtual void eval( Kernel::EvalState * evalState ) const; */
39 /* virtual const Ast::SourceLocation & firstLoc( ) const; */
40 /* virtual const Ast::SourceLocation & lastLoc( ) const; */
41 /* }; */
43 class LetDynamicECExpr : public Expression
45 Ast::SourceLocation idLoc_;
46 const char * id_;
47 Expression * expr_;
48 public:
49 LetDynamicECExpr( const Ast::SourceLocation & loc, const Ast::SourceLocation & idLoc, const char * id, Expression * expr );
50 virtual ~LetDynamicECExpr( );
51 virtual void analyze_impl( Ast::Node * parent, Ast::AnalysisEnvironment * env, Ast::StateIDSet * freeStatesDst );
52 virtual void eval( Kernel::EvalState * evalState ) const;
55 /* This isn't a function in the sense that it returns.
57 class ContinueDynamicECFunction : public Lang::Function
59 Ast::SourceLocation idLoc_;
60 const char * id_;
61 Expression * expr_;
62 public:
63 ContinueDynamicECFunction( const Ast::SourceLocation & idLoc, const char * id, Expression * expr );
64 virtual ~ContinueDynamicECFunction( );
65 void push_exprs( Ast::ArgListExprs * args ) const;
66 virtual void analyze_impl( Ast::Node * parent, Ast::AnalysisEnvironment * env, Ast::StateIDSet * freeStatesDst );
67 virtual void call( Kernel::EvalState * evalState, Kernel::Arguments & args, const Ast::SourceLocation & callLoc ) const;
68 virtual void gcMark( Kernel::GCMarkedSet & marked ){ };
69 virtual bool isTransforming( ) const { return false; }
72 class GetECBacktraceExpr : public Expression
74 Ast::SourceLocation idLoc_;
75 const char * id_;
76 public:
77 GetECBacktraceExpr( const Ast::SourceLocation & idLoc, const char * id );
78 virtual ~GetECBacktraceExpr( );
79 virtual void analyze_impl( Ast::Node * parent, Ast::AnalysisEnvironment * env, Ast::StateIDSet * freeStatesDst );
80 virtual void eval( Kernel::EvalState * evalState ) const;
84 class IfChain : public Expression
86 Ast::SourceLocation loc_;
87 std::list< IfExpr * > * clauses_;
88 Expression * elseexpr_;
89 public:
90 IfChain( const Ast::SourceLocation & loc, std::list< IfExpr * > * clauses, Expression * elseexpr );
91 IfChain( const Ast::SourceLocation & loc, std::list< IfExpr * > * clauses );
92 virtual ~IfChain( );
93 virtual void eval( Kernel::EvalState * evalState ) const;
94 virtual const Ast::SourceLocation & firstLoc( ) const;
95 virtual const Ast::SourceLocation & lastLoc( ) const;