Relative Content

Tag Archive for parsing

How to choose a proper parser generator for PHP

Some programmers avoid regexes in some situations (see this popular @nickf comment), perhaps using a parsing framework such as Lex/Yacc. Others prefer to stay within PHP, perhaps using regular expressions, as it avoids the need for another framework.

Should I use a formal grammar for my interpreted scripting language

I have a scripting engine I just published as an open source project. It’s been sitting on my harddrive waiting for about a year. My engine of course isn’t complete in any way, but it does work for simple scripts. It has a javascript-ish feel to it, but I don’t wish to abide by the ECMA spec or anything.

Writing a Compiler Compiler – Insight on Use and Features

This is part of a series of questions which focuses on the sister project to the Abstraction Project, which aims to abstract the concepts used in language design in the form of a framework. The sister project is called OILexer, which aims to construct a parser from grammar files, without the use of code injection on matches.

Chosing a parser for a code beautifier

I’m in the planning stage of making a code beautifier (similar to AStyle or Uncrustify) – originally I was going to just contribute to one of those projects,
but reviewing their source led me to the conclusion that I have different design goals and that their source is written in a way that makes it difficult for an outsider to easily contribute. AStyle, for example, instead of building some sort of AST, uses over 100 state variables such as isInComment, foundClassHeader, isLineReady, etc.

Why was strict parsing not chosen for HTML?

I have often wondered why strict parsing was not chosen when creating HTML. For most of the Internet history, browsers have accepted any kind of markup and tried their best to parse it. The process degrades performance, permits people to write gibberish, and makes it difficult discontinue obsolete features.

Why was strict parsing not chosen for HTML?

I have often wondered why strict parsing was not chosen when creating HTML. For most of the Internet history, browsers have accepted any kind of markup and tried their best to parse it. The process degrades performance, permits people to write gibberish, and makes it difficult discontinue obsolete features.

What the correct algorithm to invert italics in a mixed text?

The question motivations was depicted in the section below.
There are many ways to make text italic,
so, perhaps, there are more than one good
swap italics algorithm“.
The problem reveals some aditional
dificulties in a XHTML code, and using the <i> tag, that must to be balanced.
Example: