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)

0
votes
0answers
12 views

Parsing a text file with a custom hierachial data structure using Python [on hold]

I have a text file with a certain data structure that looks like this. I have intended it to make the structure clearer, but in reality they are all aligned, and there are no bullet points. Ellipses ...
2
votes
1answer
36 views

Finding an arbitrary word in a string of words given an offset

Background Given a string (s) and an offset into that string (offset), find the whole word that can be found at the given ...
4
votes
0answers
33 views

Parsing cron expression

I'm building my own scheduler and I took the first step by creating a cron expression parser. To test it I used this expression to cover each case. (I guess the 52W is wrong but this doesn't matter ...
4
votes
1answer
47 views

Python Hex Viewer

I have created an hex viewer in python, as a timed-challenge by friend. My implementation was in the form of a class, with a separate main file running with ...
3
votes
0answers
26 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! ...
0
votes
0answers
14 views

Wyld: Lightweight Javascript tool for creating input-output mappings

I've created a lightweight library for handling input-output mappings by just using a "configuration" object as the map. Here's a snippet of the README: To create a direct mapping from an exact ...
6
votes
2answers
375 views

Small part of an INI parser

I know there are probably thousands of INI parser implementations in C. Nevertheless I want to implement one to learn the art of parsing grammar. I just wrote a small piece of the INI parser and ...
4
votes
0answers
32 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 ...
3
votes
2answers
85 views

Delimited File Reader

UPDATE: I have refactored the code into a Gist using @Dmitry's answer as a guide. The update is much simpler to grok, implements IDisposable, and is roughly thirty ...
3
votes
2answers
91 views

Matching maximal nodes with velocities

I have written a code which works very good for small data-files (see below). The data file 'WSPL.dat' which I want to evaluate has a size of 2.6 GB and the data file 'VELOC.dat' has a size of 4.3 GB....
3
votes
0answers
23 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 ...
1
vote
3answers
54 views

Look for patterns in the keys of an array, to group them in a new array

I am working on a function that will take a an array of options. These options are retrived from a database, and could have other options inputted throughout the system. When adding my options, I am ...
2
votes
1answer
131 views

Analyze Shakespeare's Macbeth parsing XML from web using Nokogiri

This is a simple Ruby program to analyze the number of lines characters speak in Shakespeare's Macbeth using Nokogiri and open-uri to parse a given url containing xml. I wrote this as practice getting ...
2
votes
1answer
51 views

Tokenizer building blocks: tokens and spans

In a completely overkill BrainFuck lexer/parser I've presented the lexer, parser, interpreter and syntax tree classes. With this post I'd like to go over the lower-level ...
14
votes
2answers
3k views

A completely overkill BrainFuck lexer/parser

I'll need to build a syntax tree (AST) for Rubberduck, but since VBA has dozens of tokens and complex rules, I needed a simpler language to play with first, so I thought BrainFuck would be a perfect ...
5
votes
2answers
55 views

Get a floating point number from a string with a finite state machine

I wanted to restart the big-float project I had paused the moment I suddenly realized that the implementation of the main four rounding modes (which I postponed so long, that I got all of the IEEE-754 ...
3
votes
3answers
104 views
1
vote
2answers
152 views

Swap first and last name in C

I took an entire line of input in the form of a string, and tokenized the string into substrings and obtained the first string as the first name and the second as the last name. This program as it ...
0
votes
0answers
29 views

Text parser in Python 2.5

I wrote a text parser which generates a necessary file. Python 2.5 is used because the code was mostly written and tested on my old Nokia with Python 2.5 onboard. Parser designed to project - scummvm ...
-1
votes
1answer
51 views

Construct: (un)dumping bytes to hex

This code is part of the Construct library. Docstrings explain what the code is supposed to do. ...
-2
votes
1answer
35 views

Construct: VarInt integer encoding

This code is part of the Construct library. Docstrings explain what the code is supposed to do. ...
0
votes
2answers
78 views

Parsing a string into a double

I'm trying to understand the strtod() function, and how I can handle any user input given to the function. I assume I tested for everything, however I am hoping for ...
1
vote
0answers
97 views

libconfini (shared library)

I recently wrote a small INI parsing library. The code is also on GitHub, with documentation. I would like to have opinions, suggestions, and critiques. confini.h ...
2
votes
0answers
19 views

Spider for House Price Website

hey guys how you all doing, I built a spider that crawls through a house price website and stores houses address and transactions on it, through a bunch of functions, and I was wondering if anyone ...
7
votes
1answer
332 views

Implementation of tokenizer object and finite state machine in C

I was given an assignment to create an implementation of a tokenizer object (by object, I mean a struct with associated functions that operate on instances of the struct). This tokenizer retrieves ...
8
votes
1answer
138 views

Log sorting program

This is my first ever program written in Rust (after reading the book). It is small tool to sort all lines from stdin according to two criteria. First one is time ...
5
votes
1answer
101 views

Delete all comments in a C program

I am new to C. And I just want to know if my code is horrible or not. I tried to make program to delete all comments in C program. It's from "The C Programming Language Second Edition" book, Exercise ...
4
votes
2answers
136 views

Tokenize a string

I used strtok to tokenize a string. But many developers said me to avoid strtok, why? How should I optimize this code? Is it ...
6
votes
2answers
72 views

Parse a file containing key-value pairs followed by coordinates of nodes in a graph

I've a file which is divided into two parts: The header The data part The header has of course a different format than the data part. The header part contains lines that look like this ...
1
vote
1answer
62 views

Building DOM tree from XML, checking/updating player's average score

This is the first time I'm parsing an XML file. So I will be grateful for any suggestions on how my code may be improved. Or if you could suggest another approach to solving this problem. One other ...
1
vote
2answers
61 views

Record parsing to Scala object with some unknown fields

I am getting some customer data but don't know the complete schema beforehand. I want to parse this data and create a Scala object from it. But due to unknown fields in the record, I fill only the ...
3
votes
2answers
26 views

Parsing and extracting all IDs from a document (using regex with capture)

I'm interested in parsing and extracting the IDs found in a document. The IDs are found throughout the document in the this format: IDStart=1FG3392MQ9&IDEnd The "1FG3392MQ9" is an example of ...
3
votes
1answer
158 views

Shunting-yard algorithm for expression parser

After reading about the Shunting-yard algorithm, I decided to try to make a expression parser, before trying to make a actual language parser, using it. The way i translated the algorithm into C++ ...
8
votes
2answers
986 views

Reading a repetitive file with repetitive code

I made this code for take some data from a .txt file. The text file is a large list of data from temperature with a format that is repetitive and have some lines at the beginning with the station ...
3
votes
1answer
62 views

hl7 parser with fparsec

I have a little experience working with .hl7 data (format for transmitting health data), so I decided to try and write an .hl7 parser using fparsec. A standard .hl7 segment is a single line with: ...
4
votes
2answers
97 views

LINQish command line parser

I needed to parse some command line switches from a string and I tried to do it the easy way so I just wrote this: ...
3
votes
0answers
43 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
2answers
29 views

Getting columns from lines of uneven length

I am given pasted data from a table, so I have spaces as delimiters and in some of the fields I don't care about. I want the first field and the last three fields, and got them using this code: ...
2
votes
0answers
199 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 ...
0
votes
1answer
62 views

Grammar lexer in C++

Here is a lexer for a grammar I'm designing. After benchmarking with 1MB files and having several iterations of the lexer, I found that coping the file being read into a buffer and lexing that buffer ...
3
votes
1answer
143 views

A from_string() function (inverse of std::to_string)

I've been thinking of using this: ...
2
votes
1answer
62 views

Overly complicated parser combinator

I recently started to learn Haskell in order to write some small tools for me. Currently I'm working on a program which calculates how much steam a (railcraft) boiler of a given size outputs per tick. ...
6
votes
2answers
115 views

Parsing Day Range with Time in Ruby

I need to shorten/simplify this code: ...
16
votes
5answers
3k views

Program that removes comments from C and C++ programs

I have downloaded the latest version of the Linux kernel and I want to perform thorough analysis on it. I want to start by eliminating comments from all the source and header files that belong to it. ...
1
vote
0answers
24 views

Functional-style Cocoa XML serializer and object mapper

I'm working on an XML-to-model-object serialization and deserialization library. There are three main design goals for the code: It should parse XML into and serialize from Cocoa-native collection ...
3
votes
4answers
251 views

CSV parsers and OrderedDictionary

I wrote the following (static) class to read files easily in C#. However, it is a static class, so I wonder if there would be a gain to make it a non static method (and therefore, passing arguments as ...
5
votes
2answers
128 views

Creating a simple Interpreter for the Quartz language

I've been trying to improve my C++ skills, and deiced to try my hand at making a interpreter for a toy language. The language is called Quartz, and so far the only thing you can do is output strings. ...
2
votes
0answers
26 views

List of lists from file

I'm writing a sub-routine in AppleScript to get text from a file and insert that text in a list of lists forming a dictionary. Text File: a:b c:d e:f Expected ...
5
votes
0answers
114 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. ...
8
votes
1answer
83 views

HTML Parser (using SAX)

Got bored writing a review on an HTML parser and decided I wanted to try. So I threw this together to see I could parse an Amazon page. ...