lib/architect/parser.rb
# [statement] String containing statement
# Returns a list of classes markup and association markup in the statement
[statement] String containing statement
Returns a list of classes markup and association markup in the statement
[ statement ] String containing statement Returns a list of classes markup and association markup in the statement
def parse_statement(statement)
      pattern = /\[(?<node1>.+?)\](?<association>.+?)\[(?<node2>.+)\]/ 
      tokens = pattern.match(statement)
      if tokens
        node1 = get_node(tokens[:node1])
        node2 = get_node(tokens[:node2])
        association = Association.new(node1, node2, tokens[:association])
        return [node1, node2, association]
      else
        tokens = /\[(?<node1>.*)\]/.match(statement)
        node1 = get_node(tokens[:node1])
        return [node1]
      end
    end
def parse_statement ( statement ) pattern = / \[ (?<node1>.+?) \] (?<association>.+?) \[ (?<node2>.+) \] / tokens = pattern . match ( statement ) if tokens node1 = get_node ( tokens [ :node1 ] ) node2 = get_node ( tokens [ :node2 ] ) association = Association . new ( node1 , node2 , tokens [ :association ] ) return [ node1 , node2 , association ] else tokens = / \[ (?<node1>.*) \] / . match ( statement ) node1 = get_node ( tokens [ :node1 ] ) return [ node1 ] end end
[statement] String containing statement
Returns a list of classes markup and association markup in the statement
[ statement ] String containing statement Returns a list of classes markup and association markup in the statement
statement
<not_specific>