Error in Plex 1.1.4.1

Discussion in 'Python' started by srijit@yahoo.com, Jan 19, 2005.

  1. Guest

    Hello,
    I got the following error while using Plex 1.1.4.1

    D:\Python24\myfiles>python plex1.py
    Traceback (most recent call last):
    File "plex1.py", line 1, in ?
    from Plex import *
    File "D:\python24\lib\site-packages\Plex\__init__.py", line 34, in ?
    from Lexicons import Lexicon, State
    File "D:\python24\lib\site-packages\Plex\Lexicons.py", line 12, in ?
    import DFA
    File "D:\python24\lib\site-packages\Plex\DFA.py", line 9, in ?
    import Machines
    File "D:\python24\lib\site-packages\Plex\Machines.py", line 14, in ?
    from Transitions import TransitionMap
    File "D:\python24\lib\site-packages\Plex\Transitions.py", line 85
    def get_epsilon(self,
    SyntaxError: Invalid syntax. Assignment to None.

    The corresponding source code :

    #file plex1.py

    from Plex import *

    lexicon = Lexicon([
    (Str("Python"), "my_favourite_language"),
    (Str("Perl"), "the_other_language"),
    (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(self,
    none = None):
    """
    Return the mapping for epsilon, or None.
    """
    return self.special.get('', None)


    Regards,
    Srijit
    , Jan 19, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hfk0
    Replies:
    2
    Views:
    21,642
  2. news
    Replies:
    0
    Views:
    513
  3. JavaQueries
    Replies:
    1
    Views:
    3,631
    John C. Bollinger
    Mar 1, 2005
  4. Peter Kleiweg

    flex: plex?

    Peter Kleiweg, Aug 17, 2004, in forum: Python
    Replies:
    4
    Views:
    699
    Peter Kleiweg
    Aug 18, 2004
  5. greg

    ANN: Plex 1.1.5

    greg, Jan 27, 2007, in forum: Python
    Replies:
    1
    Views:
    323
Loading...

Share This Page