Hello I am trying to make a simple lexer, to read KML(google maps). But I have a problem in several parts. And get an "unspecified token error"(ONLY included the part causing the error)
import ply.lex as lex
import re
tokens = (
'PLACEMARKER_1'
'ENTRYNAME',
'COORDINATES'
'PLACEMARKER_2',
)
t_PLACEMARKER_1 = r'<Placemark>'
t_ENTRYNAME = r'<name>.*</name>'
t_COORDINATES = r'<Point>\n<coordinates>[0-9]+(?:\.[0-9]+)*,[0-9]+(?:\.[0-9]+)*,0</coordinates>\n</Point>'
t_PLACEMARKER_2 = r'</Placemark>'
t_ignore = ' t\v\r'
hl = lex.lex()
hl.input(Test_1)
while True:
tok = hl.token()
if not tok: break
print tok
Please help, it will be appreciated... :D
Remember to use commas... Always remember to use COMMAS!