ply Questions
6
Solved
Ok, so I've asked a bunch of smaller questions about this project, but I still don't have much confidence in the designs I'm coming up with, so I'm going to ask a question on a broader scale.
I am ...
2
Solved
I'm doing a lexer as a part of a university course. One of the brain teasers (extra assignments that don't contribute to the scoring) our professor gave us is how could we implement comments inside...
Heeled asked 5/10, 2020 at 14:37
3
Solved
I'm working with a fairly simple parser in PLY, and one of my rules takes on the following form:
def p_things(p):
'''
things : thing things
things : thing
'''
p[0] = [p[1]]
if len(p) == 3:
...
Slake asked 20/6, 2011 at 20:1
4
Solved
I have a .PLY file that contains a 3D Point Cloud: I want to plot it and visualize it in Python.
The .PLY file contains ONLY vertex and NOT faces.
Could you indicate me a simple Python libr...
Inchmeal asked 21/6, 2018 at 9:58
2
Solved
I am using ply and have noticed a strange discrepancy between the token re match stored in t.lex.lexmatch, as compared with an sre_pattern defined in the usual way with the re module. The group(x)'...
2
Solved
I'm working on a simple translator from SQL INSERT statements to a dataset XML file to be used with DbUnit.
My current definition looks like this:
def t_INSERT(token):
r'INSERT\s+INTO'
return t...
1
I am writing my own parser with PLY. I want to encapsulate the lex and yacc respectively
Here is the code
for class Lex:
class Lex:
tokens = (
'NAME', 'NUMBER',
)
literals = ['=', '+', '-',...
Marela asked 8/7, 2016 at 8:50
1
I was trying to parse the function definition for the python language with PLY.
I am encountering issues related to the indentation.
For instance for a for statement, I would like to be able to kno...
Ziguard asked 4/11, 2013 at 17:55
2
Solved
6
Solved
I'm using an older version of PLY that uses the md5 module (among others):
import re, types, sys, cStringIO, md5, os.path
... although the script runs but not without this error:
DeprecationWar...
5
Solved
I am using PLY in a command line application that I package as a Python egg to be installed via pip. Everytime I run my script from the command line, I see the following message:
"Generating LALR ...
3
Solved
Background:
As a short project over winter break, I'm trying to implement a programming language called Axe (designed for graphing calculators) using Python and PLY. A brief note: the language allo...
Oatis asked 27/12, 2011 at 7:58
2
My objective is to parse like Python does with strings.
Question: How to write a lex to support the following:
"string..."
'string...'
"""multi line string \n \n end"""
'''multi line string \n \...
2
Solved
Forgive me if I have the incorrect terminology; perhaps just getting the "right" words to describe what I want is enough for me to find the answer on my own.
I am working on a parser for ODL (Obje...
3
Solved
im using the python module ply.lex to write a lexer. I got some of my tokens specified with regular expression but now im stuck. I've a list of Keywords who should be a token. data is a list with a...
2
Solved
I'm using ply as my lex parser. My specifications are the following :
t_WHILE = r'while'
t_THEN = r'then'
t_ID = r'[a-zA-Z_][a-zA-Z0-9_]*'
t_NUMBER = r'\d+'
t_LESSEQUAL = r'<='
t_ASSIGN = ...
3
Solved
I am working on a simple SQL select like query parser and I need to be able to capture subqueries that can occur at certain places literally. I found lexer states are the best solution and was able...
1
Solved
I am trying to parse a string using the yacc parser provided in the PLY library for Python.
The parser itself is very long, but the problem that i am having is that it always gives me the same erro...
1
Solved
I know there are other tools out there to parse SQL statements, but I am rolling out my own for educational purposes. I am getting stuck with my grammar right now.. If you can spot an error real qu...
Mcdonough asked 8/9, 2011 at 22:57
1
Solved
The empty production rule
nonterminal -> epsilon
is useful in lex-yacc LR bottom up parser generators (e.g. PLY).
In what context should one use Empty productions in PEG parsers e.g. pyparsi...
4
Solved
I am writing a parser using ply that needs to identify FORTRAN string literals. These are quoted with single quotes with the escape character being doubled single quotes. i.e.
'I don''t understand...
1
© 2022 - 2024 — McMap. All rights reserved.