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)

7
votes
1answer
45 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
58 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
0answers
68 views
+50

A 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
41 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
51 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
24 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 ...
1
vote
1answer
38 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
84 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
62 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
24 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
106 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. ...
6
votes
1answer
36 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
14 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
38 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
110 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
26 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
22 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
3 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
175 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
68 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
99 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
65 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
51 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
45 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
312 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
143 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
68 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
28 views

recursive descent parser

Here is a non-predictive recursive descent parser I wrote for the following grammar: ...
5
votes
1answer
69 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
66 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
77 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
79 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), ...
1
vote
1answer
48 views

Parsing US addresses without regular expression for performance

Looking for some constructive feedback on Parsing an Address without using Regular Expression in C# for performance purposes. My aim is to clean the data and to separate it into its respective ...
1
vote
1answer
156 views

Parsing .PLY file using F#

I'm fairly new to F# and have written a program to parse PLY files - this is however done in an imperative way with mutable values and as far as I know that should be avoided in functional languages. ...
4
votes
2answers
102 views

Parse HTML to modify it

I'm using the following code to parse html, This code is working but since I'm new to JavaScript and working in alone project I would appreciate if you can give me some tips and feedback how can I ...
2
votes
1answer
23 views

tcl script to parse C++ source code for type identifiers

Experimenting with vera++ to validate some C++ source files. https://bitbucket.org/verateam/vera/wiki/Home vera++ is expandable by providing your own rules in tcl. To interface with the vera++ parser ...
2
votes
1answer
110 views

Loading data from a text file into the database as fast as possible

I'm building a Django (1.8.12) application that parses a .bc3 file (Standard Interchange Format for Databases of Construction and Real State) and loads all the data into the database (PostgreSQL 9.3.9)...
3
votes
1answer
67 views

Parsing speech out of text

I'm working on an experiment to parse speech out of an emote in a text roleplaying game (MUD) so that if you can't hear it correctly, or if it's in a different language, you won't understand it. This ...
4
votes
2answers
106 views

Parsing a string as fast as possible that is using comma delimiters

I have made a simple static parser for a bigger program. This parser takes a string that has comma deliminators and I need to separate the strings in to a vector for handling in a different section of ...
2
votes
1answer
31 views

Read group of keywords from file, modify value, store new group to variable

I would like to use the following routine in my submission script for GAMESS calculations. I am not entirely sure if this is the optimum way to go. This function would need one of the messaging ...
4
votes
1answer
47 views

Extend API of complex source-code parsing CPAN module

I am working on a source line parser using PPI. After working a while, I realized that it would be nice if the PPI API had ...
2
votes
1answer
39 views

Simplified error handling when reading from stdin and parsing to a type

I've recently started learning Rust, and I've managed to whip up this function, which reads and parses a thing from stdin. I don't like it though, and I feel it ...
5
votes
1answer
55 views

`read` re-implemented for Int's

I have written a safe read function for haskell (for education!). I think this is fairly idiomatic haskell code, but I'd like to know for sure. If you see anything else that could be improved, please ...
2
votes
1answer
42 views

Getting the program's first argument as a number

I want to get the first argument as a number, if there is any. This does not feel quite right, but I don't know yet what the Rust way would be. I'm not searching for a args-framework or something, I ...
2
votes
1answer
33 views

Java class that parses Shoutcast stats XML

I have written a Java class that parses Shoutcast 2 stats XML. It uses JDOM to parse the XML. I have only basic knowledge of Java and I wrote this class in about 3 hours. It works, but I don't know if ...
7
votes
3answers
123 views

Prolog parser written in Haskell

I am writing a very simple Prolog intepreter in Haskell. It's a class assignment and I really want to do it right. I was able to (quite quickly) write a parser for the language. Today I borrowed a ...
1
vote
1answer
146 views

Converting an SVG polygon path from relative to absolute coordinates

This question was moved from StackOverflow as suggested by some users. I developed a function that aims to (should) provide a simple and effective method to transform a polygon ...
3
votes
0answers
32 views

Memory efficient Log Parser

I wrote this together for a test I'm doing that parses the Heroku access log. What I'm mainly interested is if this code follow common best practices and if there are any improvements I can make in ...