Linked Questions
147 questions linked to/from Writing a parser like Flex/Bison that is usable on 8-bit embedded systems
1 vote
0 answers
484 views
Recursive descent parser in PHP [duplicate]
Possible Duplicate: Is there an alternative for flex/bison that is usable on 8-bit embedded systems? I wanted to make this parser for a long time now, but I don't even know where to start from. ...
110 votes
6 answers
44k views
Are GCC and Clang parsers really handwritten?
It seems that GCC and LLVM-Clang are using handwritten recursive descent parsers, and not machine generated, Bison-Flex based, bottom up parsing. Could someone here please confirm that this is the ...
35 votes
6 answers
24k views
Boolean expression (grammar) parser in c++
I want to parse a boolean expression (in C++). Input form: a and b xor (c and d or a and b); I just want to parse this expression into a tree, knowing the precedence rule (not,and,xor,or). So the ...
100 votes
2 answers
55k views
Where can I learn the basics of writing a lexer?
I want to learn how to write a lexer. My university course had an assignment where we had to write a parser (and a lexer to go along with it) but this was given to us with no instruction or feedback (...
53 votes
1 answer
41k views
Constructing an Abstract Syntax Tree with a list of Tokens
I want to construct an AST from a list of tokens. I'm making a scripting language and I've already done the lexical analysis part, but I have no idea how to create an AST. So the question is, how do I ...
41 votes
4 answers
67k views
Parsing an arithmetic expression and building a tree from it in Java
I needed some help with creating custom trees given an arithmetic expression. Say, for example, you input this arithmetic expression: (5+2)*7 The result tree should look like: * / \ + 7 /...
51 votes
5 answers
56k views
Example parsers to learn how to write them [closed]
I am looking for source codes of parsers and/or parser generators that could be studied in order to develop further, my skills that I acquired during a school course. Do you know any recommendable ...
16 votes
10 answers
16k views
Writing a simple equation parser
What sorts of algorithms would be used to do this (as in, this is a string, and I want to find the answer): ((5 + (3 + (7 * 2))) - (8 * 9)) / 72 Say someone wrote that in, how could I deal with so ...
22 votes
6 answers
4k views
A parser for regular expressions in PHP?
I need to parse regular expressions into their components in PHP. I have no problem creating the regular expressions or executing them, but I want to display information about the regular expression (...
34 votes
3 answers
15k views
Tutorials for writing a parser with Javascript [closed]
I've seen a couple of languages (namely CoffeeScript and LessCSS) that are built on Javascript. Are there tutorials anywhere for writing languages/parsers with Javascript?
21 votes
5 answers
8k views
Evaluating a mathematical expression (function) for a large number of input values fast
The following questions Evaluating a mathematical expression in a string Equation parsing in Python Safe way to parse user-supplied mathematical formula in Python Evaluate math equations from ...
31 votes
4 answers
12k views
Lex and Yacc in PHP [closed]
Is there an implementation of Lex and Yacc in PHP? If not, can anyone suggest a lexical analyser and parser generator (ie, anything like Lex and Yacc) that will create PHP code. I'm not too worried ...
10 votes
5 answers
10k views
How do you write an arithmetic expression parser in JavaScript, without using eval or a constructor function?
Given a string: var str1 = "25*5+5*7"; Without using eval or the constructor function in JavaScript, how would I be able to write a function called "output" that takes in the string and outputs the ...
12 votes
4 answers
11k views
PHP Lexer and Parser Generator? [closed]
I know question Lex and Yacc in PHP was asked before but 1 year ago. Is there any new mature PHP parser generator now? My searches drove me to the following ones, what do you think about them, any ...
7 votes
7 answers
6k views
Is the ANTLR parser generator best for a C++ app with constrained memory?
I'm looking for a good parser generator that I can use to read a custom text-file format in our large commercial app. Currently this particular file format is read with a handmade recursive parser but ...