I'm trying to extend the example grammar of PEG.js for parsing mathematical expressions with all the 4 operators for my online BASIC interpreter experiment:  http://www.dantonag.it/basicjs/basicjs.html  but not all the expressions are parsed corr...
I am looking for a peg.js grammar expression for matching against:   "variable" # Fails "variable." # Fails "" # Fails "variable.variable" # Ok "variable.variable.variable.variable.variable" #Ok   input I expec...
How do you build an AST (Abstract Syntax Tree) for left-associative operators using PEG.js?  I've tried to write some code based on the information I found on the internet, but I seem to have made a mistake.  The code I wrote generates an incorre...
I have essentially the same question as PEG for Python style indentation, but I'd like to get a little more direction regarding this answer.  The answer successfully generates an array of strings that are each line of input with 'INDENT'...
I'm trying to build a simple parser with PEG.js.  I want the user to be able to input a series of keywords, with an optional "AND" between them, but I can't seem to get the optional and working.  It always expects it, even though I...
I'm playing around with PEG.js  start = keyword  keyword = a:[a-z]? {return a.join("");}   Why am I getting here the error:     a.join is not a function   when I enter a valid string like abc?...
I'm trying to read the information from a STEP-file (ISO 10303-21) with javascript. I'm not sure how to tackle this at all.  I have found open source alternatives but in all languages but Javascript... So I'm not able to learn much from t...
I'm trying to catch some text between parathesis with a semicolon in the end.  Example: (in here there can be 'anything' !"#¤);); any character is possible);  I've tried this:  Text  = "(" text:(.*) ");" { return...
How can I read the file within my language?  I am trying to understand how languages ??work. I would like to know how to create a simple grammar to read files using Peg.js. In Python it is something like this  f= open("testfile.txt","w+&#...
I am having trouble defining an expression that allows any text between two tags (including those tags).  Examples:  #ifdef  asdasdasdasdasdsasd asdasdasdasdasdasdasd asdasdasdasdasdasasd #endif   It should also allow  #ifdef asdasdasd asdasdsad #ifd...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.