示例#1
0
# Token definitions:
# Use textual context nn[idx][1] for development, numeric nn[idx][0]
# for production use.
#
# The order of the definitions do not matter.
#
# To add a new syntactic element, search for an existing feature (like 'wrap')
# Add the new element into the a.) definition, b.) regex defintion,
# c.) state definition, d.) state table, e.) action function.
#
# The script is self checking, will report on missing defintions. However,
# it can not (will not) report on syntactic anomalies.
#

parser.tokdef = \
         [parser.unique(), "span"   ],      \
         [parser.unique(), "espan" ],       \
         [parser.unique(), "it"     ],      \
         [parser.unique(), "eit"    ],      \
         [parser.unique(), "bold"   ],      \
         [parser.unique(), "ebold"  ],      \
         [parser.unique(), "itbold" ],      \
         [parser.unique(), "eitbold"],      \
         [parser.unique(), "ul"   ],        \
         [parser.unique(), "eul"  ],        \
         [parser.unique(), "dul"   ],       \
         [parser.unique(), "edul"  ],       \
         [parser.unique(), "ncol"   ],      \
         [parser.unique(), "ncol2"   ],     \
         [parser.unique(), "encol"  ],      \
         [parser.unique(), "nbgcol"   ],    \
示例#2
0
文件: test3.py 项目: pglen/pgpygtk
#!/usr/bin/env python

import sys, os, re, time
import pygtk, gobject, gtk, pango

# Our modules

print os.path.dirname(os.path.realpath(sys.argv[0]))

import panglib.parser as parser
import panglib.pangodisp as pangodisp
from panglib.utils import *

print parser.unique()
print parser.unique()
print oct2int("10")