Analyzing (un)structured data to convert it into a structured, normalized format.

learn more… | top users | synonyms (1)

1
vote
2answers
107 views

Language/Programming term for paired delimiters [on hold]

Can someone help me find the language and/or programming term for delimiters (?) that must be paired? Quotes, parenthesis, angle-brackets, square-brackets, etc. are often used to symbolize these ...
0
votes
0answers
25 views

Expr looping in Expr parsing [closed]

On PHP 7 parser.y, we have: L236 a top_statement, that refer: L307 a statement, that refer: L312 a unticked_statement, that refer a expr ";": L1078 a expr, that refer: L776 a expr_without_variable, ...
2
votes
2answers
125 views

“Hand written” recursive descent parser with “catch all” rule

I'm trying to write a (scannerless) recursive descent parser with a "catch all" rule for the following "Mustache template" grammar (simplified here): content : (variable_tag | section_tag | ...
1
vote
1answer
54 views

File validation rules

I have an application that can accept CSV files to run some operations. The files look like: CREATE USER:username,last_name,first_name,age user1,Smith,John,23 user2,Poppins,Mary,257 There are a ...
2
votes
0answers
55 views

Truncating HTML content at specific content blocks

I have HTML content in my DB and I would like to present a list of these individual items but truncate each of them so they're not fully displayed. I would like to keep truncated items ...
0
votes
1answer
143 views

Is it bad to implement a language in other two languages? [closed]

Ok, so I have some understanding about parsers and compilers, at least the basics of how it works, and i've written a calculator and a really small toy language that compiles to another high-level ...
2
votes
0answers
50 views

Argument over performance using Convert.ChangeType in Web Applications [duplicate]

A debate has been going on at work about using Convert.ChangeType. A couple of fundamental assumptions to this discussion are delineated below: 1. The discussion is within the context of web ...
1
vote
2answers
66 views

Passing context around AST nodes

I have various objects inside my AST, such as IfBlock, FunctionBlock, LogicExpression, etc. All of those objects share a context, which is basically a hashmap with some variables. It's a very simple ...
1
vote
1answer
76 views

Writing a parser on top of an XML-based AST: am i doing it right?

I have a sort of AST defined in XML that i'm trying to parse and evaluate. The XML tree contains the tokens and all the information i need. However, i'm finding it difficult to do it "properly". ...
1
vote
1answer
84 views

Run a c++ program under lots of different data maps

I want to run a c++ program to process a lot of data from different xml files and output results. I run the program once per file and potentially have around 50 different files. The trouble is each ...
0
votes
0answers
63 views

Matching groups of similar lines on a generic matching algorithm

I have to write a program to search through a file containing lines and find lines that match to a degree of tolerance but are not necessarily the same. So for example the following lines would match: ...
3
votes
1answer
151 views

Recursively parse without resorting to ugly design patterns

I'm currently building a crochet pattern parser in Java, and I've hit upon some trouble. I'll call the language used for input Crochet Pattern Code (CPC). I have a rather large writeup on the ...
1
vote
0answers
117 views

Calculating uncompressed file size without uncompressing file in zlib

I am writing a python program which parses zip (currently only zlib, using DEFLATE compression) files and verifies the correctness of their headers and data. One of the things I'm trying to achieve is ...
2
votes
2answers
184 views

When to use ANTLR and when to use a parsing library

I've always wanted to learn how to write a compiler - I've decided to use ANTLR, and am currently reading through the book (its very good by the way) I'm pretty new to this, so go easy, but the jist ...
0
votes
0answers
110 views

Writing Z80 table based assembler/disassembler

I have a long-term project: DIY computer with various processors. One of my wishes not only make hardware, but software too. So I started from assembler/disassembler for Linux, though there is a lot ...
1
vote
1answer
56 views

Can table of content be parsed using some formal grammar?

A table of content can look like: Preface Table of Content Chapter 1 ... 1.1 ... 1.1.1 ... 1.1.2 .... 1.2 ... Summary Exercises Chapter 2 ... ... Appendix ... A ... A.1 ... A.2 ... B ... References ...
2
votes
0answers
64 views

Loop Unfolding and Named Significant Bits

I've been writing a Parser Compiler for the last seven or so years, and I recently got to the point (yet again, never satisfied) of structuring the portion dealing with the portions of the language ...
0
votes
3answers
296 views

Why Double.parseDouble(“ABC”) not returns Double.NaN?

This code: Double.parseDouble("ABC") throws a NumberFormatException. Why is it wrong to expect a Double.NaN (NaN is literally Not-A-Number). A working example is this: public static void ...
-1
votes
2answers
537 views

What is the simplest and universal algorithm for parsing C++ code? [closed]

I need to do some project specific automatic checking of source codes written in C++ Limitations: Algorithm and its implementation should be simple, easily maintainable, extendable and ...
1
vote
0answers
631 views

Best practices to parse a log file using Python

I'm writing a Python tool to parse a log file from game server. The log file is of format: ms:classname::id::method::arg1::arg2.... There are a lot of classes, and a lot of methods for each class, ...
1
vote
0answers
66 views

Pre-Compilation Processor:

What I want to do: Parse source code, search for a beginning and closing tag of my own definition (one that does not conflict with any defined patterns in the programming language), and then replace ...
3
votes
2answers
185 views

Process to generate hierarchical structure based on relational data?

I have a csv of employee ids, names, and a reference column with the id of their direct manager, say something like this emp_id, emp_name, mgr_id 1,The Boss,, 2,Manager Joe,1 3,Manager Sally,1 ...
-2
votes
2answers
94 views

file quantity limit in a directory on a linux file server and why?

What is a good limit to use on the quantity of files in a directory, and why? EDIT: Why shouldn't someone create a system that puts hundreds of thousands of files in the same directory? Why I ask: ...
0
votes
2answers
136 views

BNF parsing rule for left associativity

Can someone please assist me with the following question. Write a BNF rule to parse into C -> E C -> E && E C -> E && E && E so that C generates as many E ...
22
votes
5answers
3k views

Name for this type of parser, OR why it doesn't exist

Conventional parsers consume their entire input and produce a single parse tree. I'm looking for one that consumes a continuous stream and produces a parse forest [edit: see discussion in comments ...
2
votes
2answers
249 views

Building a string parser for user command and control?

My goal is to build a command parser that has basic syntax and multiple possible branches at each point. These commands come from users of the system and are text input (no GUI). The basic syntax is ...
6
votes
2answers
504 views

In layman's terms, what is left recursion?

According to one page on code.google.com, "left recursion" is defined as follows: Left recursion just refers to any recursive nonterminal that, when it produces a sentential form containing ...
0
votes
1answer
56 views

What is latent parsing in NLP?

I'm reading a paper describing a NLP work, and I hardly catch the concept of a term, "latent parsing". Original paper: http://web.stanford.edu/~angeli/papers/2013-acl-temporal.pdf The figure in the ...
5
votes
1answer
721 views

Why did GCC switch from Bison to a recursive descent parser for C++ and C?

Was there a language change that required it or some practical reason why Bison was no longer appropriate or optimal? I saw on wikipedia that they switched, referring to the GCC 3.4 and GCC 4.1 ...
5
votes
3answers
2k views

How exactly is an Abstract Syntax Tree created?

I think I understand the goal of an AST, and I've built a couple of tree structures before, but never an AST. I'm mostly confused because the nodes are text and not number, so I can't think of a nice ...
3
votes
1answer
73 views

How to parse different number types with LALR(1)

Consider a LALR(1) parser for a file format that allows integer numbers and floating point numbers. As usual, something like 42 shall be a valid integer and a valid float (with some automagic ...
0
votes
1answer
39 views

Rule order for Parsing Lists with LALR(1)

When creating the grammar for parsing a list (something like “ITEM*”) with a LALR(1) parser, this basically can be done in two ways: list : list ITEM | ; or list : ITEM list | ...
29
votes
2answers
3k views

Do modern languages still use parser generators?

I was researching about the gcc compiler suite on wikipedia here, when this came up: GCC started out using LALR parsers generated with Bison, but gradually switched to hand-written ...
0
votes
2answers
115 views

Large csv's to html report

I am working on a web front end + front end services. I receive good sized csv files (10k lines). My service processes them and condenses them into one larger csv file (up to 300k lines). This ...
3
votes
2answers
137 views

Need overview of concepts and tools to translate a DSL to regular expressions

I'm looking for a little guidance. Until this morning, this was all over my head. After spending today researching Wikipedia, StackOverflow, etc., I'd say I've got my nose above the water. I'm tasked ...
-1
votes
1answer
49 views

How to keep AST for feature access?

Consider such code (let's say it is C++) Foo::Bar.get().X How one should keep the AST for this -- as "tree" with root at left Foo(Bar(get(X)), or with root at right (((Foo)Bar)get)X? Or maybe as a ...
1
vote
3answers
498 views

Parsing mathematical expressions with two values that have parentheses and minus signs

I'm trying to parse equations like the ones below, which only have two values or the square root of a certain value, from a text file: 100+100 -100-100 -(100)+(-100) sqrt(100) by the minus ...
0
votes
2answers
205 views

High-level strategy for distinguishing a regular string from invalid JSON (ie. JSON-like string detection)

Disclaimer On Absence of Code: I have no code to post because I haven't started writing; was looking for more theoretical guidance as I doubt I'll have trouble coding it but am pretty befuddled on ...
4
votes
4answers
916 views

What is the responsibility or benefit of a Tokenizer?

Suppose I had a grammar like: object { members } members pair pair string : value value number string string " chars " chars char char chars number digit ...
1
vote
2answers
238 views

Lexer/Parser for multidimensional Languages

How does Lexer/Parser work in a 2D programming language like Funciton in order to transform such an unusual source-code to the correct AST?
0
votes
3answers
272 views

Do markup languages ​​have the equivalent concept of `semantics` that you can find in C or C++?

Maybe I miss something, but do the so called markup languages have the equivalent concept of semantics that you can find in C or C++? Judging from how you parse the language, you don't really have ...
2
votes
1answer
240 views

How and when should I design a simple mark-up language parser? [closed]

I want to write a simple markup language with its rendering engine. First, I am not completely sure when I should try this... I am only 12... But I am competent in C++ having learned through the Web ...
0
votes
2answers
157 views

Implementing a first basic interpreter: what should I learn first? [duplicate]

I'm about to implement my own very simple programming language, and an interpreter to execute code in that language. The language will be very basic. Example code: var x = 3 if x > 2 print x if x ...
1
vote
2answers
296 views

Traversing an AST using Visitors

I'm writing a compiler for a C-like language, and I'm looking for an elegant way to traverse my abstract syntax tree. I'm trying to implement the Visitor pattern, although I'm not convinced that I'm ...
0
votes
0answers
42 views

Dedupe while or after write

I have a summary tool written in python that reads input files, and writes them into a summary file. I have the following stipulations: No duplicates. If it exists, add a count to it. Is it ...
0
votes
2answers
96 views

Storing tokens during lexing stage

I am currently implementing a lexer that breaks XML files up into tokens, I'm considering ways of passing the tokens onto a parser to create a more useful data structure out of said tokens - my ...
-2
votes
1answer
351 views

What is the right way to parse HTML? [closed]

I've heard, that parsing HTML using the Cthulhu way is not very good. But what are the right ways to parse HTML? Or is it possible to parse it at all?
6
votes
2answers
376 views

Slight extension for SQL prepared statements syntax. Need advice

In my database abstraction library I am extending SQL prepared statements syntax to hint a parser with expected literal type. I take it as a very essential improvement, my reasoning you can read here. ...
0
votes
1answer
165 views

Making a sldprt to PDB file converter?

I wanted to create a parser that can read a solidworks file and turn it into a protein data bank file. This has already been done in a program called DiamondCAD. ...
1
vote
1answer
274 views

About AST construction in LL1 non recursive parser

I have implemented a LL1 parser in a non recursive approach with a explicit stack. The following algorithm is from the Dragon Book: set zp to point to the first symbol of w; set X to the top stack ...