Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(21)  |  Call(12)  |  Derive(0)  |  Import(9)

src/m/e/mediawiki-parser-HEAD/parser.py   mediawiki-parser(Download)
 
# get the parser
from pijnu import makeParser
preprocessorGrammar = file("preprocessor.pijnu").read()
makeParser(preprocessorGrammar)
 
mediawikiGrammar = file("mediawiki.pijnu").read()
makeParser(mediawikiGrammar)

src/p/i/pijnu-HEAD/tests/test_toolset.py   pijnu(Download)
from pijnu.tests import ParserTestCase
from pijnu import makeParser
 
 
class ToolsetTests(ParserTestCase):
    numbers    : number (addedNum)*    : extract
"""
        make_parser = makeParser(numbers_transform_grammar)
        parser = make_parser()
        source = "1 3.141592 5"
    numbers    : number (addedNum)*    : extract
"""
        make_parser = makeParser(numbers_transform_grammar)
        parser = make_parser({'to_real': to_real})
        source = "1 3.141592 5"

src/p/i/pijnu-HEAD/test/profile.py   pijnu(Download)
'''
 
from pijnu import makeParser
 
 
numbers		: number (addedNum)*		: extract
"""
    makeParser(numbersTransformGrammar)
 
 

src/p/i/pijnu-HEAD/test/ok.py   pijnu(Download)
from pijnu import makeParser
numbers_transform_grammar = """\
test_custom_toolset_numbers_transform
<toolset>
def to_real(node):
    numbers    : number (addedNum)*    : extract
"""
make_parser = makeParser(numbers_transform_grammar)
parser = make_parser()
 

src/p/i/pijnu-HEAD/test/bug4.py   pijnu(Download)
"""
Reading the grammar as UTF-8 raises an exception
"""
 
from pijnu import makeParser
import codecs
fileObj = codecs.open("bug3.pijnu", "r", "utf-8")
grammar = fileObj.read()
make_parser = makeParser(grammar)

src/p/i/pijnu-HEAD/test/bug3.py   pijnu(Download)
"""
 
from pijnu import makeParser
grammar = file("bug3.pijnu").read()
make_parser = makeParser(grammar)

src/p/i/pijnu-HEAD/test/bug2.py   pijnu(Download)
"""
Calling a repetition inside another produces an infinite loop.
"""
 
from pijnu import makeParser
    numbers    : number (addedNum)*    : extract
"""
make_parser = makeParser(numbers_transform_grammar)
parser = make_parser()
print parser.parseTest('1 2 3')

src/p/i/pijnu-HEAD/test/bug1.py   pijnu(Download)
"""
 
from pijnu import makeParser
numbers_transform_grammar = """
test_custom_toolset_numbers_transform
    numbers    : number (addedNum)*    : extract
"""
make_parser = makeParser(numbers_transform_grammar)
parser = make_parser()
print parser.parseTest('1 2 3')

src/m/e/mediawiki-parser-HEAD/tests/__init__.py   mediawiki-parser(Download)
# -*- coding: utf8 -*-
from unittest import TestCase
 
from pijnu import makeParser
 
def setup_module():
    preprocessorGrammar = file("preprocessor.pijnu").read()
    makeParser(preprocessorGrammar)
 
    mediawikiGrammar = file("mediawiki.pijnu").read()
    makeParser(mediawikiGrammar)