Class: Crokus::Ast
- Inherits:
-
Object
show all
- Defined in:
- lib/crokus/ast.rb
Direct Known Subclasses
Body, CondExpr, Decl, Define, DesignUnit, Expr, FormalArg, FunCall, Function, FunctionProto, ITE, Ident, Include, Literal, Sizeof, Stmt, Type, Typedef
Instance Method Summary
collapse
Instance Method Details
#accept(visitor, arg = nil) ⇒ Object
5
6
7
8
|
# File 'lib/crokus/ast.rb', line 5
def accept(visitor, arg=nil)
name = self.class.name.split(/::/)[1]
visitor.send("visit#{name}".to_sym, self ,arg) end
|
#str ⇒ Object
10
11
12
13
|
# File 'lib/crokus/ast.rb', line 10
def str
ppr=PrettyPrinter.new
self.accept(ppr)
end
|