1. David Bindel
  2. gmllua


gmllua /

Filename Size Date modified Message
2.3 KB
1.3 KB
51 B
# Introduction

gmllua is a Lua extension for processing GML (Graph Modeling Language)
files.  The core is just a little C parser for GML that produces a
nested table data structure in Lua that mirrors the structure of the
GML file.  For example, if the file "foo.gml" is

    # A test graph

    graph [
      name "foo"
      node [ id 0 ]
      node [ id 1 ]
      edge [
        source 0
        target 1

then the command 

    result = gml.read "foo.gml" 

is equivalent to

    result =
      graph = {
        name = "foo",
        node = {
          {id = 0},
          {id = 1}
        edge = {source = 0, target = 1}

In addition to gml.read, there are a variety of functions in
gmllib.lua that manipulate the resulting Lua data structure in various
ways and write files with the derived results.

# Building and installing.

You need to have Lua 5.2 installed (get it from www.lua.org).  If you
have it installed in /usr/local, you can build with "make arch", where
arch refers to a platform target (type "make" to see a list of
convenience platforms).  If you have it installed elsewhere, you may
need to change the flags in src/Makefile.

Once you have build the code, you can install the binary by running
"make install".