Skip to main content

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.

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 ...
Giogre's user avatar
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 ...
viuser's user avatar
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. ...
138 Aspen's user avatar
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. ...
Brendan Wilson's user avatar
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 ...
Snowking's user avatar
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 ...
srilakshmikanthanp's user avatar
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 ...
S0AndS0's user avatar
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 ...
Tobias Grothe's user avatar
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 ...
Tobias Grothe's user avatar
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-...
M. Saintourens's user avatar
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-...
Schilive's user avatar
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 ...
zoravur's user avatar
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 ...
sbottingota's user avatar
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 ...
Cecilia's user avatar
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" (...
xiazhu's user avatar

153050per page
close