Class: GraphViz::Parser::Subgraph

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/graphviz/parser.rb

Instance Method Summary collapse

Instance Method Details

#eval(context) ⇒ Object



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/graphviz/parser.rb', line 195

def eval( context )
  # puts "CREATE SUBGRAPH : #{name.text_value}"
  
  # Save options
  saved_options = context.options.clone
  # Save graph 
  saved_graph = context.graph
  
  # Create Graph
  context.graph = context.graph.add_graph( name.text_value.gsub(/"/, "") )
  #context.options = {
  #  :node => {},
  #  :edge => {}
  #}
  
  # Eval cluster
  cluster.eval( context )
  
  # Reinitialize graph and options
  context.graph = saved_graph
  context.options = saved_options
end