Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
139 views

I'm implementing a recursive descent parser for a mini-shell program based on bash, where typically, right recursion is applied. However, for logical operators && and ||, this approach doesn't ...
Saad Out03's user avatar
0 votes
1 answer
81 views

I am working on this java program, which is a recursive descent parser. The output provided below does not contain any syntax errors, however the program printing an error message. The program should ...
metsys's user avatar
  • 13
1 vote
2 answers
321 views

I'm trying to write a function, which returns a list of elements from any level of nesting from the html, containing the word 'products' in its text, case insensitive. here is my function: def ...
antonio_oreany's user avatar
0 votes
1 answer
79 views

I have coded a tokenizer and a recursive parser for a postfix expression. My code is the following: import re token_patterns = [ ('OPERATOR', r'[+\-*/]'), ('NUMBER', r'\d+'), ('WHITESPACE'...
Little's user avatar
  • 3,477
0 votes
1 answer
89 views

I am writing a small scripting language for a project I am working on. I wrote a simple recursive-descent parser for it (similar to the one in the Crafting Interpreters). I wanted to add support for ...
Abdelfattah Radwan's user avatar
0 votes
0 answers
186 views

I have a requirement to execute dynamic expressions for the input data (Map) using Java Code. For Example, Condition - EmployeeShift = 'General' AND (EmployeeType = 'CONTRACT' OR Designation IN 'ADMIN'...
User1512's user avatar
-1 votes
1 answer
176 views

In the next sample structure BOM: updated screenshot we find articles, and further down we find their structure with its content, other articles which in their turn may or may not have their content ...
wiwi_99's user avatar
0 votes
0 answers
45 views

How do i know if a language can be parsed by recursive descent parsing? For example, how would i go about determining whether this language can be parsed in that manner: Language = { s^p r^q | p > ...
yes12345's user avatar
0 votes
1 answer
142 views

I was wondering what makes languages possible to be parsed with recursive descent. for example we have 5 languages over {x,y,r}: A = { x^n y^n | n <= k } B = { x^n y^k | n > k } C = { x^k y^n | ...
phuck's user avatar
  • 23
1 vote
0 answers
140 views

I created the following grammar for a minishell, but i realized that the parser never goes to command_p, it only stays at cmd_prefix. Can somebody please clarify for me since i've seen a similar ...
MannBell's user avatar
0 votes
1 answer
364 views

I need to make a recursive descent parser that follows the grammar <program> → <statements> <statements>→ <statement> | <statement><semi_colon><statements> &...
Dagun's user avatar
  • 31
0 votes
1 answer
49 views

I am trying to figure out a JSF*uck grammar. I read the actual JavaScript grammar here and only took the grammar rules that were relevant to JSF*ck and got this: Expression: AdditiveExpression ; ...
Lorenzo's user avatar
  • 710
1 vote
1 answer
327 views

My code is a follows (this code 100% works, it just doesn't use recursive descent) import java.awt.Component; import java.awt.FlowLayout; import java.awt.GridLayout; import java.io.File; import java....
Corey Hodges's user avatar
2 votes
1 answer
353 views

N.B.: This is the first javascript function I've written. My question is inspired by another question inquiring about recursive descent within a MongoDB document. I tried the function on jsfiddle.net ...
rickhg12hs's user avatar
0 votes
0 answers
126 views

I'm trying to write a parser that accepts a toy language for a software project class. Part of the production rules relevant to the question in EBNF-like syntax is given here (there's way more ...
TF.Ryan's user avatar
  • 63
1 vote
0 answers
457 views

Following up on Converting EBNF to BNF, which has a rule of: From EBNF to BNF For building parsers (especially bottom-up) a BNF grammar is often better, than EBNF. But it's easy to convert an EBNF ...
xpt's user avatar
  • 23.6k
0 votes
0 answers
189 views

I am making a graphing calculator and the issue I am having is finding a way to take in inputs like sin(90) and run my function for sin that I coded into another file. I am using a recursive descent ...
Irodi's user avatar
  • 1
0 votes
0 answers
481 views

I want to clearly classify top down parsers. After reading lot of resources, i am connecting the dots. I concluded following - There are 2 types of top down parsers - One that uses backtracking ...
user3699192's user avatar
0 votes
1 answer
420 views

I am constructing an LL(1) parser (Recursive Descent Parser) and I need to parse the sentence a = 3, I have two procedures to match that rule: parse_assignment and parse_binary_operator, each function ...
Jonathan1609's user avatar
  • 1,937
0 votes
2 answers
402 views

The question is to write a recursive-descent parser for a language that contains sentences of form w+w', in which w is an arbitrary string of lowercase chars, w' is the reverse of w, and + the plus ...
Khanh Nguyen's user avatar
1 vote
1 answer
365 views

I've been stuck with the dcl program from chapter 5.12 in K&R C. It is basically a program which accepts a C variable/function/table declaration and prints a description of it in English. It works ...
raf_135711's user avatar
0 votes
1 answer
61 views

I am trying to create grammar for a naive top-down recursive parser. As I understand the basic idea is to write a list of functions (top-down) that correspond to the productions in the grammar. Each ...
JFreeman's user avatar
  • 1,004
0 votes
1 answer
165 views

I am trying to realise precedence climbing in Haskell, following this specific algorithm: compute_expr(min_prec): result = compute_atom() while cur token is a binary operator with precedence >= ...
Károly Tóth's user avatar
3 votes
2 answers
1k views

Okay this is a bit of an involved question, but tl;dr it's basically how do you parse an "actual tree" using a "pattern tree"? How do you check if a particular tree instance is ...
Lance Pollard's user avatar
0 votes
0 answers
99 views

I'm new here and have a generall question. I'm trying to create a recursive descent parser for the evaluation of mathematic expressions, and the parser I have crafted until now also works very good ...
Lucy's user avatar
  • 1
0 votes
2 answers
98 views

I'm trying to build a C compiler from scratch. Googling took me to the https://craftinginterpreters.com/ site. There are a lot of explanations how source code parsers work in detail. I've reached &...
IC_'s user avatar
  • 1,899
0 votes
1 answer
844 views

I'm trying to build a recursive descent parser that builds an AST as it goes. The language is fairly simple; x >/</= y #x, y can be any letter/number, matched by regex. Then, AND/OR with ...
Omri. B's user avatar
  • 461
1 vote
1 answer
231 views

I'm trying to write a recursive descent parser. I need a method that converts the string to a stream, so I can use a next method. Everywhere I read, it says that StreamTokenizer is outdated and ...
Omri. B's user avatar
  • 461
0 votes
0 answers
70 views

I have the following code. It's a recursive descent parser with backtracking. /*\ /*\ |*|--------------|*| |*| Grammar: |*| |*| A -> ( A ) B |*| |*| | [ A ] B |*| |*| | n B ...
Aphrontos's user avatar
2 votes
1 answer
682 views

I'm trying to make a recursive descent parser in F#. I looked at http://www.fssnip.net/bM but this type of parser uses a string instead of a list. I'm struggling with parsing parentheses, and ...
justForFun's user avatar
0 votes
1 answer
103 views

I've been thinking and a question has arisen. Does this type of compiler really need the complete syntax tree in memory?
lzcmz's user avatar
  • 1
0 votes
1 answer
288 views

I have grammar: S -> bU | ad | d U -> Ufab | VSc | bS V -> fad | f | Ua To contruct recursive descent parser I need LL(1) form. Best I got is: S -> bU | ad | d U -> fY | bSX Y -> ...
jvinkovic's user avatar
1 vote
0 answers
216 views

First of all, I know there are a lot of answers and resources already available regarding this topic. However, I'm having a really hard time understanding the grammar notation that is often used in ...
rempas's user avatar
  • 133
0 votes
1 answer
190 views

I have the following simple LL(1) grammar, which describes a language with only three valid sentences: "", "x y" and "z x y": S -> A x y | ε . A -> z | ε . I have ...
user200783's user avatar
  • 14.5k
-1 votes
1 answer
59 views

I have a certain toy language that defines, amongst others, procedures and procedure calls, using EBNF syntax: program = procedure, {procedure} ; procedure = "procedure", NAME, bracedblock ; ...
SRSR333's user avatar
  • 312
1 vote
2 answers
425 views

Despite my limited knowledge about compiling/parsing I dared to build a small recursive-descent parser for OData $filter expressions. The parser only needs to check the expression for correctness and ...
AndreasS's user avatar
  • 384
0 votes
1 answer
808 views

this the continuation of me trying to make a recursive descent parser--LL(1)-- that takes in infix expressions and outputs RPN. Here is a link to my first question to which @rici did an amazing job of ...
AM429's user avatar
  • 366
0 votes
1 answer
1k views

We recently learned about converting infix to postfix using stacks during our programming course at uni. And I have meaning to write my parser for a while, so I decided to it using recursive descent. ...
AM429's user avatar
  • 366
0 votes
1 answer
970 views

GCC/Clang are handwritten parsers. I read a post saying that C++ can't be parsed by an LR(1) parser (Why can't C++ be parsed with a LR(1) parser?). If so, how come GCC/Clang are handwritten ...
xilpex's user avatar
  • 3,305
0 votes
0 answers
393 views

Recently I wrote a (highly optimized) LALR(1) parser (that could handle ambiguous grammars) and supplied it a very ambiguous grammar. After that, I wrote a recursive descent parser for the same ...
xilpex's user avatar
  • 3,305
2 votes
0 answers
227 views

I am trying to write a top-down recursive-descent parser for a small language, and I am facing some issues with the assignment statements. Here is the grammar from the language specifications: <...
Touloudou's user avatar
  • 2,293
0 votes
0 answers
469 views

I am writing a recursive descent parser for parsing a specific grammar, and I have to do the nested if/else in that grammar. The grammar is as follows: <statement> ::= if <cond> <...
Harshini Aitharaju's user avatar
-1 votes
1 answer
276 views

I am currently trying to build a recursive descent parser that parses assignment statements such as a = 4 + b. The grammar looks as follows <stmt> → id = <expr> <expr> → <term>...
Ikechukwu Anude's user avatar
1 vote
1 answer
134 views

I'm looking for an answer to this Stack Overflow question: Can somebody walk me through what this question is trying to ask of me? It asks to do the following, as the person who replied to it explains:...
user avatar
0 votes
1 answer
59 views

I would like to implant recursive search using python, it will partition the upper part for the given key example: list[2, 4, 6, 9, 10] for the key is 6 case, the return index is 3 for the key is 4 ...
gladiesgoodluck's user avatar
1 vote
1 answer
114 views

The following programming languages question seems really unclear and what it wants me to do is not obvious to me, could somebody help me to understand it? The question: Implement part of a ...
Daniel Decker's user avatar
7 votes
1 answer
2k views

I have recently come across PEG parsers, and Guido van Rossum's article on PEG parsers and how to construct them. That article talks about "PEG" parsers but internally it looks exactly like ...
Monolith's user avatar
  • 1,157
0 votes
0 answers
176 views

I am trying to build a compiler in javascript and until now I've managed to build a lexer that creates tokens based on input: = Test Input (with optional semicolon): data myVariable = 4 data ...
Alex Tudor's user avatar
2 votes
1 answer
2k views

I had an assignment problem were I had to parse a tokenized prefix calculator notation on a pre-defined AST. We were given a pretty complete algorithm for parsing (we had to add some stuff). The ...
clickedok's user avatar
2 votes
1 answer
557 views

I am trying to create my own recursive descent parser in python, but when my parser runs into a rule concerning arithmetic expressions, it surpasses the python recursion limit. Here is the grammar: ...
Monolith's user avatar
  • 1,157

1
2 3 4 5