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.

learn more… | top users | synonyms (1)

8
votes
2answers
387 views

Break a full name into a dictionary of its parts

It seems like I'm repeating myself here. Is there a standard way to deal with code like this? ...
2
votes
1answer
31 views

Efficiently calculating differences between file using diff file

I'm using SVNKit to get diff information between two revisions. I'm using the diff utility to generate a diff file, however I still need to parse it into numbers. I implemented a solution, but it is ...
0
votes
1answer
32 views

JavaScript to parse json that can be, string, object and array

I have to parse a json object that can be a string, array, array of strings and array of object. I realised that it's not good from the beginning that one object can be many types, but I can't change ...
2
votes
1answer
47 views

Optimizing Java HTML parser

I wrote a program that goes through a webpage and returns matches of regex. I used it on my letterboxd.com account to go through all of my movies (over 900 entries) and then find genres field for each ...
3
votes
0answers
31 views

Haskell Parsec parser of Verilog-style number literals

I've set myself the task to write a function that parses Verilog-style number literals. In Verilog, numbers are written like this: 8'b10101100, ...
6
votes
2answers
52 views

Bash script to extract HTML comment into a Markdown file

I learned Bash a million years ago. I just wrote this simple script used to get the first lot of HTML comments from a file, and spit it out in order to create a ...
0
votes
1answer
40 views

Parse 2D matrix, 2 versions

I'm writing a little C program that computes matrices (for learning purpose). The matrix is fed through arguments in the following form : "{{43,543.324,34},{43,432,87}}" The user doesn't give the ...
1
vote
0answers
22 views

Parsing latitude and longitude, using Try[T] to ignore errors

I wrote this question asking about how to implement my error handling while still maintaining functional code and based on 200_success's very interesting note on the spaces, I decided to ...
3
votes
0answers
10 views

Decompose string into parenthesed blocks in OCaml

The purpose of the OCaml code below is to decompose (or "parse") a string into parenthesed (or possibly non-parenthesed) blocks. ...
3
votes
2answers
46 views

Convert a String with comma separated latitudes and longitudes to a Seq[Coordinate]

I have a function that receives a String like the following: "-10.0 -10.0,10.0 10.0,0.0 0.0" And needs to translate that into ...
1
vote
2answers
37 views

Postman collection parser which injects collection to Jira/xray addon

I'we created an interface that communicates with Postman collection and Jira api more precise the Xray addon for jira. I would much appreciate if you could give me notes on how to improve this code. ...
7
votes
0answers
56 views

Using argparse module within cmd interface

I've created an application that uses a cmd interface. It has multiple levels, and the number of available commands and their complexity is growing. As such, I need to generalise argument parsing - of ...
6
votes
0answers
42 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 ...
13
votes
1answer
79 views

#TODO Remove duplication in XML parsing

I have to modify the number of points in this XML in order to test the performance of another program of mine. Here is an example of the XML I have to modify. performance.xml: ...
2
votes
2answers
108 views

Effective way to handle multiple time string to timestamp

I have 4 cases of time string as follow: s = "July 5, 2016, 12:04 a.m." s = "July 5, 2016, 7 a.m." s = "July 5, 2016, midnight." s = "July 5, 2016, noon." I want to convert string to timestamps....
7
votes
1answer
64 views

Fraction or integer parser

Question How can the following implementation of fractionParse be made less ugly? (Preserving unreduced numerators and denominators is supposed to be a feature---...
4
votes
2answers
77 views

Mathematical input parser

I made a simple math expressions solver that using a "for" loop iterates over all the characters and stores the numbers and signs in std::vector. It give support for unlimited parentheses and does ...
2
votes
1answer
139 views

PHP web crawler

I'm working on a "nice" crawler that start with one URL, and find the other URLs to process each page, a kind of "Google" crawler, to index pages. I worked hard on this crawler to respect many points ...
5
votes
2answers
43 views

Splitting a CAN bus log in .asc format

I've written a quick script for a coworker to split a large CAN log into smaller chunks. (If you're not familiar with CAN, it's a communication protocol used by the ECUs in many cars.) I know where ...
1
vote
1answer
57 views

Math expression parser in JavaScript

I've written the second iteration of my math expression parser, utilising what I learned from the first attempt to make a more reliable, maintainable piece of code. If anybody wants to see the first ...
1
vote
1answer
33 views

Vim command parser

I have a parser which consumes an ordered list of tokens (based on Vim's command grammar) and returns either: an error object, or an object that can be directly ...
2
votes
1answer
42 views

Parsing and executing a simple shell script

I'm writing a simple shell and want to parse and execute a simple shell script. ...
1
vote
1answer
87 views

Type converter framework (v2)

This is the second version of my type converter framework. The the previous one can be found here: Type creator service & framework In this version I mostly implemented what @Dmitry Nogin ...
3
votes
2answers
63 views

Type creator service & framework

I needed a mechanism for creating types dynamicaly from strings and bytes etc. I tried really hard to use the .net's TypeConverter system as it seemed to be the ...
4
votes
1answer
26 views

Parsing Gaussian09 frequency calculations, reformatting depending on desired output

Quite similar to my earlier review this script parses a frequency calculation and reformats the found values to either fit into one row for easier importing into a spreadsheet software or a formatted ...
2
votes
0answers
142 views

Binary protocol variability V3.0

Summary: Parsing an incoming stream of events from a binary communication protocol, if we have some variations in devices to support and would not like to have one huge switch to include everything. ...
3
votes
2answers
50 views

Netstring parser in common lisp

Below is a netstring parser I wrote in Common Lisp. The docstring contains the usage and return. ...
6
votes
1answer
39 views

Quoted string parser

I have written a string parser that is designed to split a string by spaces, excluding spaces wrapped in strings. Here is some example inputs and outputs: ...
2
votes
2answers
15 views

Resolve dependencies from output of PBS queueing system

I have written a script, that reformats the output of qstat -f1 of the PBS queueing system. Unfortunately this project is by far too big to post here complete, also ...
4
votes
2answers
40 views

Parsing Gaussian 09 output for energy statement on one or more files and reformat it to a table

I am a computational chemist working with the program Gaussian 09. After I manually check the output(s) I want to create a summary for easier processing of the obtained values. Also avoid opening all ...
5
votes
2answers
128 views

Simple Tokenizer + Parser

Requirements A function is needed, that is able to parse a list of symbols with the following rules: Symbols may be associated with numbers or not. Numbers are defined by a comma separed list ...
1
vote
0answers
32 views

Shortcode parser in Javascript

I've written a naive shortcode parser in JS that parses shortcodes akin to those found in Wordpress. The intention is for this to be used in realtime on the client in order to preview edits on the ...
3
votes
1answer
23 views

Mathematical equation syntax tree

I'm writing these pieces of code to parse expressions in the context of a dice rolling application for DnD. It's pretty much my first try using TypeScript and I'm ...
0
votes
0answers
4 views

Most performant filtering method for nested XML using Google Apps Script

Assuming a theoretical XML hierarchical file exported from an analysis tool thus: ...
7
votes
3answers
191 views

ini file parser in C++

Please review my ini file parser (and potentially some general config file formats). The data structure used is a section, see below. Does that seem a good approach? I was wondering about the name. ...
2
votes
2answers
69 views

Enum for converting between field naming conventions

Based on this question and this answer, I decided to try the enum approach to do some more conversions I need in my application. This time I required to convert between the different field naming ...
3
votes
2answers
112 views

Parsing a string with named sections and a key-value pair on each line

I have a response String as shown below which I need to parse it and store it my class. Format is shown below: task name followed by this dotted line -------------...
1
vote
1answer
72 views

FIRST and FOLLOW sets calculator in Haskell

I found myself wanting to brush up on some notions about parsers and grammars and, at the same time, to exercise my Haskell - I am a Haskell newbie; moreover, I haven't touched the language at all in ...
2
votes
2answers
53 views

Shell command-line interpreter with pipeline parsing

Like many others I've been writing a shell command-line interpreter that can do a pretty decent pipeline parsing, first it splits the command at pipeline char (|), then it splits the substring at ...
2
votes
1answer
47 views

Pen-and-Paper Dice Roller Tool

A friend asked me to write a pen-and-paper dice roller, so I put this together. I'm still pretty new to Java Swing, so I was hoping I could have some advice on how I handled the layouts and everything,...
2
votes
0answers
32 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 ...
4
votes
4answers
332 views

Data type detection for a CSV file parser

I am building a CSV file parser, and in order to get the appropriate Object to represent different data types found on the parsed files, I wrote the following function: ...
2
votes
1answer
144 views

Delimited file parser

This is some code I've cobbled together that reads a delimited file. If the user is able to tell us some stuff about the file, it uses the supplied information. Otherwise, it tries to work stuff out ...
2
votes
1answer
73 views

Parsing a string containing arithmetic operations in prefix notation

This is a piece from the complete program. What it does is parses mathematical expressions of the form (+(*3,x),5) to 3*x + 5 ...
4
votes
1answer
29 views

recursive descent parser

Here is a non-predictive recursive descent parser I wrote for the following grammar: ...
5
votes
1answer
72 views

run command pipeline in C

This code parses and tokenizes my shell language command interpreter. I will try and make it 2 functions, one that is the tokenizer and the other that is the rest of the function. Can you find ...
2
votes
1answer
70 views

Parsing in between of brackets

I do parsing of the string in order to find wrapped sub-string inside brackets of the first level. a+(b+(d-g))+g+d, in this case I will need to separate ...
7
votes
2answers
80 views

Parsing 4 Million Filenames

This is the next step in my project to query Companies House records. The first step, retrieving and validating the company numbers to be targeted, was covered here and I will include that code at the ...
0
votes
1answer
84 views

Tokenizing a shell command

I want to handle input like the following ls -al | awk '{print $1}' Now to parse it I couldn't tokenize at whitespace because of the quotations and I had to make ...
0
votes
2answers
48 views

Extracting data from a string

I created a method that takes a string value with a fixed length of 9 characters and extracts three values, house (4 characters), ...