Error in Plex 1.1.4.1

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • srijit@yahoo.com

    #1

    Error in Plex 1.1.4.1

    Hello,
    I got the following error while using Plex 1.1.4.1

    D:\Python24\myf iles>python plex1.py
    Traceback (most recent call last):
    File "plex1.py", line 1, in ?
    from Plex import *
    File "D:\python24\li b\site-packages\Plex\_ _init__.py", line 34, in ?
    from Lexicons import Lexicon, State
    File "D:\python24\li b\site-packages\Plex\L exicons.py", line 12, in ?
    import DFA
    File "D:\python24\li b\site-packages\Plex\D FA.py", line 9, in ?
    import Machines
    File "D:\python24\li b\site-packages\Plex\M achines.py", line 14, in ?
    from Transitions import TransitionMap
    File "D:\python24\li b\site-packages\Plex\T ransitions.py", line 85
    def get_epsilon(sel f,
    SyntaxError: Invalid syntax. Assignment to None.

    The corresponding source code :

    #file plex1.py

    from Plex import *

    lexicon = Lexicon([
    (Str("Python"), "my_favourite_l anguage"),
    (Str("Perl"), "the_other_lang uage"),
    (Str("rocks"), "is_excellent") ,
    (Str("sucks"), "is_differently _good"),
    (Rep1(Any(" \t\n")), IGNORE)
    ])

    filename = "plex1.txt"
    f = open(filename, "r")
    scanner = Scanner(lexicon , f, filename)
    while 1:
    token = scanner.read()
    print token
    if token[0] is None:
    break

    The error was removed when I used the following code in Transitions.py

    def get_epsilon(sel f,
    none = None):
    """
    Return the mapping for epsilon, or None.
    """
    return self.special.ge t('', None)


    Regards,
    Srijit
Working...