Parsing refers to the action by software of breaking an artifact into its constituent elements and capturing the relationship between those elements.

learn more… | top users | synonyms (1)

4
votes
1answer
27 views

String parsing/stripping code

I am mostly interested in how the parse_string function could be improved. But any comments on my test strategy also welcome. The input is a string which can be ...
12
votes
2answers
123 views

I think I might be having a regex nightmare

I've been working on the Rubberduck (an add-in for the VBA Editor /"VBE"), specifically here the VBA.Parser namespace. Here's how I ended up implementing the syntax ...
8
votes
2answers
67 views
+50

Making kexec reboots less painful

kexec is a way for a Linux kernel to directly boot another Linux kernel without going through the usual BIOS startup sequence, which can take several minutes on enterprise servers. The big problem ...
3
votes
1answer
37 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's a bit too slow, but it works fine as far as I tested. ...
3
votes
2answers
28 views

Cut float numbers in a stream (putchar, getchar) and in a string

For example, the following row: "a+12.3456-b-0.456789+1.3-45678" will be transformed into "a+12.34-b-0.45+1.3-45678" That is, we need to cut out the figures after the point from the third figure. ...
7
votes
1answer
379 views

Math expression parser in C#

EDIT: Added refactored version 2.0 to the end! I have a parser that is supposed to take a string similar to a math expression and return a Tuple of: An array of strings where each string ...
14
votes
0answers
220 views
+50

A header-only linear-time C++11 PEG parser generator supporting left-recursion and grammar ambiguity

I've rewritten my original parser generator to a header-only library which uses templates and functionals for better type safety and clarity. The generated parser creates an abstract syntax tree which ...
1
vote
1answer
23 views

Refactoring conditions in text parsing method

I am writing a generic text parser and have come up with the following text parsing algorithm, which works fine. I'm wondering how to refactor the following method to make it easily understandable and ...
4
votes
1answer
72 views

Simple attribute parser for HTML

I am studying Java and trying to write an HTML parser, which should parse tag names and attributes. I wrote a class (code below) using the State pattern. This is necessary for my training project, ...
1
vote
0answers
49 views

Parsing PHP-style nested query string parameters

I searched all over for a query string parser that could handle nested parameter names ala parse_str in PHP. I was unable to find anything, so this is what I've ...
2
votes
2answers
48 views

CSV File Parser in Ruby - Attempt No. 2

The following is my second attempt at a basic CSV parser in Ruby. I've addressed suggestions that I've got for my previous version here. I have omitted all test cases - the code listing would be too ...
6
votes
2answers
338 views

The Bucketizer Script

This code is written in a SSIS Script Component that basically accomplishes what I previously had as a T-SQL script, that was reviewed here. I need to split a 80 character string that contains 20 ...
2
votes
1answer
30 views

Printer Color Templates

I'm new to Python and I just wrote my first program with OOP. The program works just fine and gives me what I want. Is the code clear? Can you review the style or anything else? ...
4
votes
1answer
198 views

Combat log parser for World of Warcraft

This is part of a bigger project I'm doing to get better at JavaScript. It's basically the beginnings of a combat log parser for World of Warcraft. It looks a bit messy right now and I could really ...
1
vote
2answers
108 views

Reading columns of a delimited text file

This class reads a delimited text file into String arrays on demand. Delimiter can be any regex. Features include: Read a single column Read a range of columns Read arbitrary columns by providing ...
0
votes
1answer
61 views
2
votes
1answer
33 views

A Java class for reading MaCH dosage files v2.0

Version 2 of A Java class for reading MaCH dosage files ...
3
votes
1answer
59 views

A Java class for reading MaCH dosage files

A dosage file (used in computational genetics) is formatted like this: ...
1
vote
0answers
54 views

Handling hours, minutes, seconds

Basically I wanted to make a generic class for parsing time codes and dealing with small units of time. I have tried to keep it very simple (small API) and 0 dependency (apart from RSpec). Some ...
2
votes
0answers
14 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) ...
8
votes
3answers
315 views

The stripping extensions

In order to make my life easier with parsing some VBA code, I have written a few extension methods to extend the string type, and put them in this ...
0
votes
0answers
23 views

HTML Tree Parsing in Perl

I finally converted my horrific HTML regex parsing: ...
8
votes
1answer
156 views

Markdown to HTML, again

I made another markdown parser. (original, this one on github). Look, I'm not crazy (sorta), I just like making markdown parsers… ...
22
votes
4answers
3k views

Someone thinks poorly of my server log parser

I have just been informed that the following code written by me is extremely poor. I have absolutely no idea why. It is memory efficient, and looks clean to me. But still the feedback is very poor. I ...
3
votes
2answers
33 views

Ruby infixed math parser

It only does expressions with 2 operands yet, but I'm wondering if there are any ways I can improve this: ...
5
votes
1answer
69 views

Parser for simple programming language

I'm writing a basic LL(1) parser in java, but my parser class is quickly getting out of hand and becoming huge. PMD even calls it a "God class" and says that it has "Too many methods." Is there a way ...
1
vote
2answers
73 views

Finding logic operators [closed]

We get the search string from the UI. Based on the search parameters we need to create a back-end query. This is similar to "Feed Item Query Language(FIQL)". I have wrote the code to find the logical ...
2
votes
1answer
32 views

Bash Script - File Comment out & Notate

I have been writing my own Bash Scripts for a little while now. I am getting a better comprehension of it and I would like to start refining my code to be more elegant. I have recently developed this ...
2
votes
1answer
38 views

Filtering JSONArray by Branding & Modelling

I have a small function that takes in a list of JSON objects that has the format below. The function below that wants to see if the brand and model of car passed to it can be matched against the List ...
0
votes
0answers
38 views

Parsing Markdown with Parsec

Are there better ways to refactor the code? I would like to avoid try. What do you think of the type-annotation-block? ...
2
votes
2answers
65 views

Splitting a Multi-FASTA file into individual files

I have written a program to split a Multi-FASTA file into individual fasta files. ...
3
votes
0answers
78 views

Parsing small sets of data from a large XML using XMLReader [closed]

Suppose I have a lot of large XMLs I want to parse data from and each of these can range in size from 10MB to well over 300MB. Now, I only need a small sub-set of data from a few specific keys. For ...
2
votes
4answers
320 views

Parsing a string to get the values of certain attributes

I have written a small method that extracts certain information from a string. An example of such a string is ...
2
votes
1answer
59 views

Creating objects from parsed file

I'm newbie in Python but I want to know some tricks to make my code look cute. I know that syntax of Python allows to do this, but I don't know how. Suppose I have file with lines of format "x y z" ...
4
votes
1answer
52 views

Parse prospero-Parameters

Prospero is a URI Scheme. There you have fields and values. Would you guys check this code and give common suggestions or even testcases for junit-Tests? Sorry Docu is in German. ...
1
vote
1answer
62 views

Mapping/parsing database table data to output data

I have currently implemented this simple example of a database to output for a REST API to show the way information is being parsed, mapped and serialized starting from database data converting it to ...
5
votes
3answers
114 views

Windows forms set saved groupbox location settings

I have a Windows form that when a user moves some groupboxes around, before the application exits, it saves those X and Y coordinates into a MySQL database (with a bit of added text to identify which ...
4
votes
1answer
25 views

Finding the next XML element

I am looking for a better way to do a while cycle with the variable update. The background is that I'm writing a StAX-line XML reader in JavaScript and want to ...
11
votes
5answers
1k views

Finding longest word in a string

I was working on a problem from Coderbyte. The challenge was to write a function that takes in a string and returns the longest word in the string. If two words are the same size then it asks to ...
12
votes
3answers
2k views
6
votes
2answers
91 views

Parse floats from a string

While fixing some old code I came up with a class that parses floats from a string. This is used for parsing svg files in xml format. Floats can be separated by comma, space or anything at all in ...
7
votes
3answers
71 views

Parsing dates from an OCR application

I wrote this code to parse dates from the output of the OCR, which means that the obtained date can be literally anything, so I put some restrictions in place: Date is the the format of: ...
11
votes
4answers
189 views

Improving the readability and efficiency of parser code

Recently, I had a test and I wrote this code, but they didn't like my code because it was "deplete and nested". In order to improve my skills, what would be good ways to make this more readable and ...
2
votes
0answers
58 views

Text parsing and calculator (calculate Java heap memory)

I'm writing small tool, which must execute jmap -heap, write output to log, then takes some data from log and calculate used memory. I added some ...
3
votes
1answer
81 views

Parsing arguments for cd command

This file manager has a code snippet that handles an argument of the "cd" console command. It converts the argument to a valid path, expands ~ and environment variables into the corresponding values: ...
5
votes
1answer
55 views

Parsing .obj 3D meshes

I have a legacy code parsing .obj 3D mesh files. However, it seems to me a bit ugly: ...
3
votes
0answers
49 views

Python API for TreeStructInfo - new simple config format

I've created a simple (300 SLOC) API for a new configuration format (I'm not the author of it). Unfortunately, the specification is only in Polish at the moment, but you can see how it looks here. ...
9
votes
3answers
142 views

Ugly workaround to get the vbext_ProcKind of a procedure is breaking encapsulation

This is a follow up to Extending the VBAExtensibility Library. It turns out that code had a really nasty bug. Anytime vbeProcedure.StartLine got called, I was ...
4
votes
1answer
115 views

Reading and Parsing JSON from a Game Server

This is my naive (but currently working) attempt at reading JSON commands from a Java game server in Objective-C. I am afraid I might be doing something wrong, so hopefully this question will be a ...
3
votes
1answer
78 views

Dirty XML-to-JSON parser

I have that XML-to-JSON function based on ElementTree. It looks very simple but until now it does what it's supposed to do: give a JSON description of the ...