Changeset 666 for proto/charsetcompiler


Ignore:
Timestamp:
Oct 15, 2010, 7:35:52 PM (9 years ago)
Author:
ksherdy
Message:

Add JSON number character set definition. Add commented out method calls to generate Python bitstream code generation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/charsetcompiler/charset_compiler.py

    r609 r666  
     1# -*- coding: utf-8 -*-
    12#
    23#  Character Class Compiler
     
    152153
    153154DefinitionSet['LI_with_MarkupPass'] = DefinitionSet['LexicalItems_with_Digit'] + [CharSetDef('AmpHashSlash', ['&', '#', '/'])]
     155
     156DefinitionSet['JSON_number'] = [CharSetDef('lex.Minus', '-'),
     157                        CharDef('lex.Zero', '0'),
     158                        CharSetDef('lex.Digit_1_9', ['1-9']),
     159                        CharSetDef('lex.Digit_0_9', ['0-9']),
     160                        CharDef('lex.Decimal_Point', '.'),
     161                        CharSetDef('lex.E_e', ['E','e']),
     162                        CharSetDef('lex.Plus_Minus', ['+','-'])]
    154163
    155164#
     
    682691    cgo = CodeGenObject([bit_var(i) for i in range(0,8)],'')
    683692    for d in chardeflist:
    684        chardef2py(cgo, d)
     693        chardef2py(cgo, d)
    685694    return cgo.showcode()# + "  return "+ py_chardefmap(chardeflist) + "\n"
    686695
     
    784793            defs = input_chardef(sys.argv[1])
    785794            print chardeflist2simd(defs)
     795            #print chardeflist2py(defs)
    786796        else:
    787797            print chardeflist2simd(DefinitionSet[sys.argv[1]])
     798            #print chardeflist2py(DefinitionSet[sys.argv[1]])
    788799    elif len(sys.argv) == 3 and sys.argv[2] == 'EBCDIC':
    789800        defs = ascii2ebcdic_chardeflist(DefinitionSet[sys.argv[1]])
Note: See TracChangeset for help on using the changeset viewer.