Questions tagged [parsing]
Use this tag for code that parses its input, or that is source for a parser generator such as yacc or lex.
1,353 questions
5votes
2answers
144views
C++ arithmetic calculator built without resorting to tree structure as conventionally done, but by parsing input string and then std::stoi
Lately I came across a book exercise that asked to implement a calculator by resorting only to std::string manipulation. I avoided C++ streams as well, as they are ...
9votes
3answers
573views
Parsing SFV files to extract and store the hashes
Similar to the class for the RAR file, now a class to extract and store the hashes from SFV files. Though this was considerably easier, there has been some code reorganisation: there is now an ...
5votes
5answers
840views
Bracket matching - Advent of Code 2021 Day 10
The following code solves Advent Of Code 2021 Day 10. The goal for this time around is evaluating whether a line of brackets is complete, has a syntax error or is missing some closing brackets. ...
7votes
1answer
96views
Recursive descent JSON parser in Rust
I've written a simple recursive descent JSON parser in Rust. It just reads in a JSON file and prints the syntax tree to the terminal. I'm still learning Rust, and I'd appreciate any review/feedback. ...
0votes
2answers
183views
Parsing information from german vocabulary [closed]
I am a beginner programmer and I want you to look at my code and let me know if i could improve something. First I have to enter the words in German, and then we have a loop that goes through each ...
2votes
1answer
176views
Getting all column vs. table regardless of alias using JSqlParser
I have been trying to get all column vs. table regardless of alias used, for example, assume this query ...
2votes
0answers
46views
Parsing dictionary list from malformed HTTP response in Vim raw channel callback
Questions Are there edge-cases that I've missed? Do HTTP response header values ever contain JSON-like data? Any style pointers related to code readability? Are there other/better Vim (versions 8 or ...
6votes
1answer
334views
Simple XML string to user-friendly plain text converter method in Java
I want to write a simple method in Java to convert XML to some user-friendly plain format (like YAML, etc.). Attributes, null, empty or zero values should not be taken into account. Also, documents ...
6votes
4answers
894views
Very simple CSV-parser in Java
Please take a look at my method for parsing a CSV string. I am looking for a simple approach without using an external library. Is throwing a RuntimeException ...
6votes
2answers
128views
C parser for reading 3D ASCII scene files
I have been interested in the project of writing a parser that reads ASCII files for a long time, mostly for educational reasons. My idea was not to use tools like Bison or Yacc but to write a hand-...
4votes
1answer
82views
Command-line parser for multiple subcommands
Explanation I have done another command-line parser here -- I am kinda obsessed. It was really verbose for the user of the parser, it grew complicated quickly with option parsing and a regular command-...
6votes
2answers
344views
Simple JSON parser in lisp
A simple recursive descent JSON parser. The entrypoint to the code is the parse function. Since I'm pretty new to common lisp, I wanted to get feedback on how to ...
5votes
1answer
76views
Parsing Lists: BIO 2024 Q2
I was practising question 2a of the British Informatics Olympiad 2024 past paper. In this task you will manipulate lists of integers to create new lists. There are three fundamental lists that you ...
8votes
1answer
844views
Operator-precedence calculator in C
Recently, I've been wanting to do some larger C projects than I'm used to, since I really like the language. So, as a first step, I decided to implement a nice calculator. My end goal is implementing ...
4votes
2answers
105views
Parsing strings indicating duration in seconds (e.g. "60", "60s", "1m", etc.)
This is a simple function that accepts a null-terminated string that represents a non-negative number of seconds. It can optionally end in the suffix "s" (seconds, default), "m" (...