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.

97 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
11 votes
0 answers
2k views

Function to conect to Firebase Rest API via Access VBA

This is the application for small school, which will store students' info in Firebase and also retrieve data from Firebase. I am using JSON Parser to parse the data and save the same in Access tables. ...
Adarsh's user avatar
  • 249
6 votes
0 answers
452 views

Parsing indented text into a tree structure in C#

My goal is to take an input stream (text file), and then parse it into a tree node based on each line's indentation. My rules are Lines can be indented using either tabs or spaces, but the file must ...
Peter Morris's user avatar
6 votes
0 answers
194 views

Character-based transitions (part of a lexer)

As part of my prep for the Code Review community-challenge (which looks like it will be Write your own programming language), I've been working on an LL(1) lexer generator in Rust. Yes, lexer ...
CAD97's user avatar
  • 1,954
6 votes
0 answers
848 views

Parsing Lua 5.2 strings with patterns

I wrote some code to parse Lua 5.2 strings in Lua 5.1, using patterns. It works perfectly as far as I tested. ...
SoniEx2's user avatar
  • 181
5 votes
0 answers
86 views

Menu Parser in C

This is a simple program that parses a menu specification and creates a menu tree. Why? I want to create a menu application, where the user can select an entry in the menu, and either a submenu can ...
Seninha's user avatar
  • 171
5 votes
0 answers
134 views

Scanning a string into a list of tokens

Here is my code: ...
dopatraman's user avatar
5 votes
0 answers
92 views

Parsing Long Excel Report Files for Predefined Results

I work as an IT intern in a multinational and I was given a tedious task of combing through a 2500+ long multi-column excel report file in search of inactive servers. Here's a sample row from that ...
baduker's user avatar
  • 1,348
5 votes
0 answers
198 views

Error Handling for XML parser

I have the following Ruby code, which parses an XML document sax style (it's a very simplified version): ...
23tux's user avatar
  • 227
5 votes
0 answers
153 views

Expressing Rebol Dates in BNF

I'm looking to define the Rebol date format in BNF notation (as adapted for Rebol Parse). I'd like as best as possible to only define valid dates—at least those that are valid in Rebol at the moment: ...
rgchris's user avatar
  • 489
4 votes
0 answers
168 views

constraint solving graduation using HTML Parsing, pandas, and z3

not sure if this project fits on code review, but my code is getting extremely messy, and would love some tips to clean it up! Overview The project is designed to take in an HTML file (a degree audit),...
retep's user avatar
  • 169
4 votes
0 answers
50 views

formatting flattened string into JSON-like object in C++, part 2

I have reworked the code from my previous (linked) post. For reference: I have a string which contains JSON-like object flattened (stringify()ed). I need to JSON-...
user3132457's user avatar
4 votes
0 answers
447 views

Wrapping argparse to use configuration file

I want to be able to both provide options through command line and from a configuration file. A single option could be served either by the user or by the configuration. But if is provided by both, ...
Adrien H's user avatar
  • 181
4 votes
0 answers
52 views

Parsing λ-terms using a very simple grammar

This is my first Rust program. It parses a string into a λ-term using a very simple grammar. Please evaluate style and use of ownerships / borrowing. ...
MaiaVictor's user avatar
  • 1,101
4 votes
0 answers
45 views

Parsing root-level elements out of HTML fragment file

I have the following code written in NodeJS, using the parse5 library. It's purpose is to parse out the root-level elements in a file containing HTML fragments (Vue ...
threed's user avatar
  • 161
4 votes
0 answers
195 views

Python - lookahead driver for a parsing chain

This is retroactive followup (that is, logically this is a followup, chronologically it isn't) to this question: link. I'm writing a parser combinator library in Python. An important thing that must ...
Michail's user avatar
  • 459
4 votes
0 answers
202 views

File operations using Groovy

The idea is to read a file - "data" - and write the information to a new file - "output" - only if it meets the criteria (if the resource usage is more than a configured threshold). Content of the ...
Here_2_learn's user avatar
4 votes
0 answers
310 views

Parsing BibTeX in JavaScript

I have a project for which I need to parse BibTeX strings. In v0.2.9 and before, I used Regex, and I want to change that. I set up a while loop system that reads ...
LarsW's user avatar
  • 141
4 votes
0 answers
447 views

Crawling and parsing meteorological data from the web into R

I am interested in collecting directly into R data published by the Mexican Met-office. The data pieces are spread through several URLs, but one can start here. There I can get the names and ...
MiEquiZ's user avatar
  • 41
4 votes
0 answers
741 views

Parsing an infix notation expression and converting to reverse polish notation

I'm pretty new to Go, and I do not know the best or idiomatic ways to do most of the stuff, so I'd appreciate feedback on how to make my code better, faster or more idiomatic. My program is a set of ...
Marc's user avatar
  • 141
4 votes
0 answers
191 views

Reading Intervals from command line

I want to parse a command line using boost.program_options. Most of my command line arguments will be intervals, which I could implement as something like ...
Christoph's user avatar
  • 507
3 votes
0 answers
106 views

Mini Scheme interpreter

Right now, I'm working on an interpreter for a subset of the Scheme programming language. It supports lambdas, let/let*/letrec, procedures, combinations, ...
TheSinisterStone's user avatar
3 votes
0 answers
74 views

Advent of Code 2021: day 10- Syntax Scoring

The following code solves day 10 in the advent of code challenge. The goal for this time around is evaluating whether a line of brackets is complete, has a syntax error or is missing some closing ...
N3buchadnezzar's user avatar
3 votes
0 answers
75 views

Python program that analyzes a corpus for randomword generation

I play a lot of old-school western CRPGs, and most of them (if not all) require the player to generate an avatar at the start of a new game, including naming the character (with names that will never ...
Ξένη Γήινος's user avatar
3 votes
0 answers
265 views

Lisp expression parser

I'm building a very simple Lisp interpreter. Similar to the the one from here. Here is what I have so far for the parsing part, that is, everything from "text is passed to the the program" ...
David542's user avatar
  • 409
3 votes
0 answers
71 views

Simple single css node parser written in rust

I am new to rust and I wrote a little program that takes a part CSS selector and returns the name of the element and two vectors containing its attributes (classes, ids) Example div#menu.big.pink =&...
Damian Grzanka's user avatar
3 votes
0 answers
456 views

Reading and parsing binary file from CAEN Digitizer (written by WaveDump)

Preliminaries I have CAEN Digitizer N6720A and use WaveDump software for the data acquisition and recording. As a result of data recording this software produces a binary file in which the sequence ...
LRDPRDX's user avatar
  • 781
3 votes
0 answers
1k views

Extract the IP address from the output of ipconfig when connected to multiple wireless networks

I am trying to extract the ip address of my machine when connected to multiple wireless networks. The motivation here is then I can make a socket connection on that ip when I have two networks that ...
Albert Rothman's user avatar
3 votes
0 answers
294 views

Parsing version from Cargo.toml

I want to get version from Cargo.toml and use the value inside my app. Here is a function I wrote: ...
philipjkim's user avatar
3 votes
0 answers
100 views

Simple General Purpose Parser Implementation

This is an implementation of a general Purpose Parser/Matcher that can operate on any input stream of objects and will return all possible combinations. In this case I do not value performance that ...
MegaIng's user avatar
  • 413
3 votes
0 answers
452 views

Converting English words to numbers in Haskell

A few weeks ago, I finished a number to word converter and received an excellent review. It caused me to make several fundamental changes to numToWord, such as ...
BrainFRZ's user avatar
  • 819
3 votes
0 answers
56 views

Multiple parsers for keywords in strings

I'm writing some code that parses strings, often using simple keywords. On parsing, the code performs various actions, such a printing a response, running functions etc. and it keeps track of whether ...
BlandCorporation's user avatar
3 votes
0 answers
712 views

Parsing simple log files in Julia vs Python

I wrote a log parser in Python and Julia. The Python version takes about 8 seconds to process 350 files, while the Julia version takes about 8 seconds to compile, after which it takes over 20 seconds ...
TigerhawkT3's user avatar
3 votes
0 answers
52 views

Sorting upcoming events listed in JSON

I've written my first program in GO, a command line tool that parses JSON containing events from a file or from STDIN and outputs the upcoming events in sorted order. Please critique it! ...
Rohan Shah's user avatar
3 votes
0 answers
321 views

Converting a sentence string to a number in Scheme

I wrote a scheme procedure that converts strings such as "Two hundred and fifty" into a number like "250" that I can use in math calculations (It's for some Natural Language Processing project). Is ...
Dawit Abraham's user avatar
3 votes
0 answers
94 views

Parser for an bifurcation analysis tool

So during my thesis I used xppaut quite extensively. In the end there were some minor problems and I decided to have a look at the code, which was just released at github. So after 30 years of on and ...
miscco's user avatar
  • 4,231
3 votes
0 answers
302 views

Console command parser for my custom Libgdx console (gamedev)

For a game I'm writing using LibGDX framework and Kotlin language, I've decided to make a dev console. This is a WIP line parser. Since there's already a decent amount of code written I've decided to ...
MrPlow's user avatar
  • 489
3 votes
0 answers
200 views

PEG parser generator

I wrote a Python PEG parser generator that takes a grammar as a string, and returns a parser. The parser can parse its own syntax, and is feature complete with the original PEG paper, with some ...
orlp's user avatar
  • 391
3 votes
0 answers
913 views

Expression parser using Shunting-yard algorithm

I've been working on a expression parser which will be part of another project (some sort of DSL). This parser basically uses the Shunting-yard algorithm, except for the case of parenthesis: here it ...
Tim's user avatar
  • 143
3 votes
0 answers
5k views

Calculator in Node.JS

I'm new to parsing, and there's only one way to learn anything, and that's to do it yourself. So I did. I wrote what is essentially a calculator. But instead you will send it a string and it will be ...
thephpdev's user avatar
  • 193
3 votes
0 answers
409 views

Haskell s-expression parser and quasiquoter

There are a number of questions on this site about s-expression parsing: e.g., Calculator parsing S-expressions and Code from "Write Yourself a Scheme in 48 Hours" tutorial. However, these ...
wchargin's user avatar
  • 1,169
3 votes
0 answers
107 views

Generation and parsing of English numerals (cardinal and ordinal)

I need to use the English numerals (American) in Haskell, so I looked for a library that did it. I have not found one, therefore I developed the program that I am presenting here. There are actually ...
Alberto Capitani's user avatar
3 votes
0 answers
65 views

URL fetcher and parser for XML feeds

Here is a program that will parse and print XML feed URLs. I want to reuse most of it to add post date to each link. This adds a new concern of CLI and output formatting on top of parsing and (poor) ...
sevo's user avatar
  • 291
3 votes
1 answer
698 views

Parser Composition - a parser directive for Boost Spirit X3

While exploring Boost Spirit X3 (documentation), I noticed that I couldn't find a parser directive that composed parsers. I dug through the source code to see how the existing directives were made, ...
Justin's user avatar
  • 3,285
2 votes
0 answers
159 views

Pillow plugin adding support for the QOI image format

Pillow is a popular library for handling images in Python. My code adds support for the QOI image format to Pillow. Aside from loading and saving QOI images, my goal was to write a streaming decoder ...
gazoh's user avatar
  • 3,004
2 votes
0 answers
145 views

How can I simplify my nom parser?

I'd like a recommendation on how I can improve the function unquoted_string below - specifically is there a better way to combine the parsers I have to achieve the ...
Kyle_S-C's user avatar
  • 233
2 votes
0 answers
20 views

Prototype of a scanner/tokenizer for Bitmap Distribution Format parser

Instead of the obvious decision, parsing using given std::io::Lines/std::io::Bytes or crates like nom, I decided to explore ...
Yamirui's user avatar
  • 21
2 votes
0 answers
27 views

Experimental parser based on a Tree of (String, Set a)

The parser function is immutable and is completely based on the forest of strings with associated properties (String,Set a). Changing the forest changes the behavior of the parser. The use of Data....
Alberto Capitani's user avatar
2 votes
0 answers
247 views

Parsing a Graph To Convert It Into Adjacency Lists And CSR And Then Make Connection Queries Using Bidirectional BFS

I was assigned an university project where I had to parse directed graph files coming from SNAP and then convert them into CSR (Compressed Sparse Row) format. Then the client must have the ability to ...
NickDelta's user avatar
  • 165
2 votes
0 answers
50 views

Ensuring a valid JavaScript string in security-critical application

I'm writing an application where users can write custom expressions which are then converted to JavaScript functions and executed. The expressions are used for filtering and sorting data from a ...
m93a's user avatar
  • 286
2 votes
0 answers
42 views

Command String Parser

I'm working on a library that, in essence, splits a string at whitespace, with extra rules: Consecutive whitespace is collapsed, and trimmed at the start and end. Whitespace wrapped in quotes is not ...
Ethan McTague's user avatar