Questions tagged [python-plyplus]

5 questions
1
vote
0 answers

grammar (with plyplus) for a small language for generating python functions

I designed a toy language : # comments n = 2 #an integer k = 3.14 # a float f(x): # a function return (x-k)^n g(z): #another function return max(z-2.9, 0.1) # max should be understood h(x,y: # another function ; note that function can call…
0
votes
0 answers

"SyntaxError: Can't build lexer" plyplus

I am doing a High Level Language, and I cannot understand why I get this error when trying to generate a lexer for it. This is my code: start : codigo; codigo : funcion* home; funcion : DEF ID PL (ID (',' ID)*)* PR LLL expresion LLR; home : HOME…
0
votes
1 answer

__init__(self, grammar, **options) and I pass (grammar_string,myoptdict): TypeError: 2 args, 3 given

I am using plyplus and just trying to get the debug option turned on. The Grammar class is defined like: class Grammar(object): def __init__(self, grammar, **options) and I am invoking it via options = { 'debug' : True } Grammar(long_string,…
Mark McWiggins
  • 621
  • 6
  • 20
0
votes
1 answer

Plyplus gives syntax error because of specific keywords?

I am using plyplus to design a simple grammar and I have been struggling with some weird error for a while. Please bear in mind I am a newbie. Here is a piece of code that reproduces the issue: from plyplus import Grammar list_parser = Grammar(""" …
-1
votes
2 answers

Python for creating a set operations Calculator

I'm trying to create a calculator, not for numbers, but for set operations. To illustrate the concept lets say you have a file with two columns. keyword, userid hello , john hello , alice world , alice world , john mars , john pluto ,…
broccoli
  • 4,738
  • 10
  • 42
  • 54