#!/usr/bin/python

names = {} 
nameValues = {}

outfile = open( '../Lua/Universal.lua', 'w' )
outfile.write( 'module("Universal",package.seeall)\n' )
outfile.write( 'require("Tethys")\n' )
outfile.write( '\n' )

# we are using regular expression matching
import re
pattern = re.compile('[\s]*const[\s]+UniversalURI[\s]+UniversalURI::([\w_]+)[\s]*[\(][\s]*\"([^\"]+)\"[\s]*[\)]')

infile = open( "../Source/data/UniversalURI.cpp")
for line in infile.readlines():
    matches = pattern.match(line)
    if matches:
        outfile.write( matches.group(1) + ' = __DECLARE_URI( "Universal", "' + matches.group(2) + '", "Universal");\n' )

infile.close()

outfile.close()    
