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
5
votes
2
answers
144
views
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 ...
9
votes
3
answers
573
views
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 ...
5
votes
5
answers
840
views
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.
...
7
votes
1
answer
96
views
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. ...
0
votes
2
answers
183
views
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 ...
2
votes
1
answer
176
views
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
...
2
votes
0
answers
46
views
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 ...
6
votes
1
answer
334
views
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 ...
6
votes
4
answers
894
views
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 ...
6
votes
2
answers
128
views
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-...
4
votes
1
answer
82
views
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-...
6
votes
2
answers
344
views
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 ...
5
votes
1
answer
76
views
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 ...
8
votes
1
answer
844
views
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 ...
4
votes
2
answers
105
views
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" (...