Questions tagged [parsing]

Parsing is the process of analysing a string of symbols, either in natural language or in computer languages, conforming to the rules of a formal grammar.

99 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9
votes
0answers
1k 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. ...
9
votes
0answers
152 views

Parser for a custom scene definition format for a raytracer

For a raytracer I’ve been writing with a classmate, we use a custom scene definition format that allows specifying shapes, composite shapes, materials, lights, cameras and transform and render ...
8
votes
0answers
255 views

PEG.js grammar for a simple programming language

I'm trying my hand at developing a compiler and have written a PEG.js grammar for a simple programming language. A sneak peak at the grammar: ...
6
votes
0answers
274 views

C++ Parsing with chain of responsibility

The task was to create the parser for the string input, that would return the std::vector< int > of parsed numeric results and the type of given input (e.g. numbers, division by zero error, out of ...
6
votes
0answers
710 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. ...
5
votes
0answers
66 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 ...
5
votes
1answer
61 views

Search for ways in OpenStreetMap extract

What does it do ? Looks in big XML files (1-3 GB) for given parameters that I need in my project, appends them to lists and finally exports both of them to the CSV files. My XML scheme I need to ...
5
votes
0answers
193 views

Python program to transform an Excel document, with some parsing

I wrote this to parse through an Excel doc, extract desired columns, parse certain cells and output another formatted Excel doc. This is the original Excel doc I have condensed most of the columns ...
5
votes
0answers
177 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): ...
5
votes
0answers
119 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: ...
4
votes
0answers
64 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, ...
4
votes
0answers
46 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. ...
4
votes
0answers
33 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 ...
4
votes
0answers
93 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 ...
4
votes
0answers
114 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 ...
4
votes
0answers
156 views

Character-based transitions (part of a lexer)

As part of my prep for the Code Rreview 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 ...
4
votes
0answers
162 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 ...
4
votes
0answers
1k views

RSS parser for Node.JS

I would like someone review this code and tell if it can be done better, or if the code is elegant and simple enough for the task at hand. I used code climate and I got 4/4 and my test coverage is 96%...
4
votes
0answers
437 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 ...
4
votes
0answers
179 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 ...
3
votes
0answers
59 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 ...
3
votes
0answers
125 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 ...
3
votes
0answers
54 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: ...
3
votes
0answers
127 views

C++ program that processes unique markup language similar to HTML

I have solved a task which takes input in a unique markup language. In this language each element consists of a starting and closing tag. Only starting tags can have attributes. Each attribute has a ...
3
votes
0answers
64 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 ...
3
votes
1answer
795 views

Multi-query PHP Parser for SQL files

I have an external project, which needs to run an SQL file containing multiple SQL queries (a bit like mysqldump, if you like, but is user-created, with any kind of SQL statement/definition). PHP ...
3
votes
0answers
196 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 ...
3
votes
0answers
50 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 ...
3
votes
0answers
537 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 ...
3
votes
0answers
112 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 ...
3
votes
0answers
83 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 ...
3
votes
0answers
116 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 ...
3
votes
0answers
671 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 ...
3
votes
0answers
268 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 ...
3
votes
0answers
80 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 ...
3
votes
0answers
58 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) ...
3
votes
0answers
597 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 ...
2
votes
0answers
35 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 ...
2
votes
0answers
31 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 ...
2
votes
0answers
99 views

Esoteric programming language in Ruby

I have recently created an esoteric programming language called 01 and I will be grateful for a code review and any opinions or suggestions about the future of this language. GitHub ...
2
votes
0answers
35 views

Convert flat object hierarchy to json

I do work for a project currently, where the data is send to the server as application/x-www-form-urlencoded (which is bad, and it should be JSON, but unfortunately I am not able to change this one). ...
2
votes
0answers
56 views

DOS header parser in Rust

Looking for feedback mostly on the from() and printf() implementations but I included everything for context. Please do not ...
2
votes
0answers
115 views

Multiformat text parser in Python

I am working on a small textract-based Python CLI tool that aims to extract text from either a single or multiple files, writing the output in corresponding text files. The input files can be of any ...
2
votes
0answers
270 views

HackerRank Attribute Parser

I wrote a program for solving the Attribute Parser challenge on HackerRank. The challenge is to read some specified number of lines of HTML-like markup (each line no more than 200 characters; for any ...
2
votes
0answers
97 views

A simple tokenizer in Erlang

I'm trying to learn Functional Programming and I picked Erlang because I will have to use it eventually. In the meantime, I'm trying to build a simple lexer to stumble upon problems and solve them ...
2
votes
0answers
645 views

Parsing XML file from the REST API

Please suggest how I can improve my code (like memory leakage, which pattern to use etc.). I have to parse a book XML in two ways: first from an FTP file and second from the REST API. I implemented ...
2
votes
0answers
37 views

XML Input Parser To Load Test Data into Dev Database

I wrote an XML input transformer to ingest data from test directory and essentially store anything into a DB table. I attempted to make this as generic as possible. I'm new to Java and also realize ...
2
votes
0answers
60 views

Parse Mach-O binding info

I wrote this C program to open a Mach-O executable/framework and parse the external symbols along with their respective framework/library. A few things I would like to get better at: Memory ...
2
votes
0answers
313 views

nom Parser in Rust

I'm attempting to make a parser using nom in Rust. Nom implements parser combinators, so more complex parsers are built from simpler parsers. Because of this, I've started with a simple ID token ...
2
votes
1answer
197 views

Simple state machine based command-line argument parser

I'm in the process of learning to write idiomatic JavaScript code so naturally I'm parsing command line arguments. My approach to this is to have a simple state machine. The parser should work as ...