Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [parsing]

This tag denotes challenges where parsing input is a large / the main part of the challenge.

19
votes
8answers
2k views

Find our missing dead

Challenge Peter has risen again to save us from the duplicate challenges! Peter Taylor is dead, and there's no doubt about it (well, apart from the huge amount of doubt we have... but just ignore ...
56
votes
2answers
6k views

Seriously, GolfScript, CJam, or Pyth?

Some time ago, the following question was asked: GolfScript, CJam, or Pyth? Based on the title only, I thought that it would be a very nice challenge, but unfortunately, it turned out to be a question ...
9
votes
1answer
567 views

Where did you COME FROM?

INTERCAL is a wonderful language, but it is not always easy to understand other people's code. This is particularly the case if they use the COME FROM statement. Challenge definition Write a program ...
15
votes
4answers
1k views

The Lazy Programmer's XML Parser

Background You are working as a programmer for a car sales company. Your task for this week is to program an XML parser that takes in data about available models from different car manufacturers, and ...
16
votes
5answers
1k views

Code Golf : Parsing google results

When you search something on google, within the results page, the user can see green links, for the first page of results. In the shortest form possible, in bytes, using any language, display those ...
10
votes
0answers
455 views

mini SPICE solver

SPICE is an electrical circuit simulation program originating from UC Berkeley. Your goal is to implement a minimalistic version which can solve for the nodal voltages and branch currents of a circuit ...
-5
votes
1answer
156 views

Compact XML Parser

Goal: The goal of this challenge is to take a simple 6 row by 6 column XML file (without the standard XML header) and parse it out so that the program can return the value of a cell given it's ...
7
votes
16answers
890 views

Parse Query Parameters

The challenge is this: You are given a url that is as follows: http://sub.example.com/some/dir/file.php?action=delete&file=test.foo&strict=true There ...
14
votes
6answers
494 views

Out-of-Control Rounding Errors

Background You have recently been hired by a small accounting firm. The world of accounting is somewhat foreign to you, so you're not sure whether you are following all the professional guidelines. ...
-3
votes
1answer
129 views

Listing links from pages — with error handling

In my previous question Debunking Stroustrup's debunking of the myth “C++ is for large, complicated, programs only”, a lot of people complained that comparison with Stroustrup's program isn't fair, ...
161
votes
57answers
38k views

Debunking Stroustrup's debunking of the myth “C++ is for large, complicated, programs only”

Stroustrup has recently posted a series of posts debunking popular myths about C++. The fifth myth is: “C++ is for large, complicated, programs only”. To debunk it, he wrote a simple C++ program ...
3
votes
4answers
638 views

Shortest parser for a left-recursive grammar

Write the shortest parser for the grammar: M -> M + n | n Output must be some representation of a structured value representing the concrete syntax tree ...
11
votes
4answers
835 views

Reduce html to n characters while keeping the formatting

Almost every language has a built-in function that can split a string at a given position. However, as soon as you have html tags in the string, the built-in function will not work properly. Your ...
11
votes
2answers
665 views

Apply English punctuation rules

You've been hired to write some code for a dictation-taking app, which takes voice input from a spoken source, parses it as words, and writes it down on a screen. The management doesn't really trust ...
4
votes
28answers
1k views

Implement an integer parser

Implement an integer parser in the shortest code possible, with the following restrictions: The function or program can only take one argument: a string (or equivalent). Assume it to be signed and ...
13
votes
10answers
1k views

Line up the CSV

Overview: Your job is to take CSV input in key=value format and line it up in a more organized (see below) way. Input: Always via stdin. Records will always be ...
19
votes
10answers
3k views

Create a programming language interpreter [closed]

Task: You must create an interpreter that can parse snippets of a programming language. The language does not need to be complex, but it must include the following syntactical elements: Ability to ...
14
votes
12answers
2k views

Brainf*ckish directions

Your task – should you choose to accept it – is to build a program that parses and evaluates a string (from left to right and of arbitrary length) of tokens that give directions – either left or right....
33
votes
18answers
3k views

Code Romanization

The challenge is to make any Roman numerals valid code in your chosen language. They should not appear inside of strings or anything similar, but work just like any other tokens, literals such as (...
12
votes
2answers
570 views

Interpret a circuit diagram

Your challenge is to interpret a circuit diagram, complete with logic gates. Logic gates (you don't actually need to know what these do / are to complete this challenge): and gate: ...
7
votes
1answer
575 views

Transform 7-segment display pattern into number

Given A and B, where A is the scale of a Digital LED Pattern B. Parse pattern B and print the number. input: ...
7
votes
5answers
493 views

Mechanical Coding

The goal is to calculate the output speed of a series of cogs. The winner will be chosen by popular vote. The arrangement of cogs is defined in an ASCII-art string: ...
10
votes
3answers
526 views

Expand tabs (implement expand(1))

Your task this time is to implement a variant of the POSIX expand(1) utility which expands tabs to spaces. Your program is to take a tabstop specification and then ...
13
votes
7answers
3k views

Reverse words without changing capitals or punctuation

Create a program with the lowest amount of characters to reverse each word in a string while keeping the order of the words, as well as punctuation and capital letters, in their initial place. By "...
9
votes
5answers
584 views

Simple Tag Parser

This is a model of a forgiving HTML parser. Instead of parsing HTML and extracting attributes, in this code golf, the tag parser will be simple. Write a function that parses a tag structure and ...