Introduction to Shift-Reduce Parsing

01.12.2010

This is a brief intuitive introduction to shift-reduce bottom-up parsing. Any compiler text should provide more details. A elementary introduction to grammars and language analysis is also available.

A shift-reduce parser uses a parse stack which (conceptually) contains grammar symbols. During the operation of the parser, symbols from the input are shifted onto the stack. If a prefix of the symbols on top of the stack matches the RHS of a grammar rule which is the correct rule to use within the current context, then the parser reduces the RHS of the rule to its LHS, replacing the RHS symbols on top of the stack with the nonterminal occurring on the LHS of the rule. This shift-reduce process continues until the parser terminates, reporting either success or failure. It terminates with success when the input is legal and is accepted by the parser. It terminates with failure if an error is detected in the input. Прочитать остальную часть записи »

VN:F [1.9.11_1134]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.11_1134]
Rating: 0 (from 0 votes)

zip linux wrong encoding

10.11.2010

«Посчастливилось» скачать дамп одной он-лайн библиотеки. Каждая книжка представляет собой файл в формате fb2 запакованный в zip архив. Что может быть лучше для КПК?

Не тут то было… fbreader видит zip, но не видит его содержимое. Распаковываю руками unzip. А там файл в непонятной кодировке.

Быстро прикрутить convmv на nokia n810 не получилось из-за отсутствия нужных perl модулей. Продолжил разбираться на следующий день на ББ. Прочитать остальную часть записи »

VN:F [1.9.11_1134]
Rating: 5.0/10 (1 vote cast)
VN:F [1.9.11_1134]
Rating: 0 (from 0 votes)

Грамматика ANSI C для Yacc

28.10.2010

В 1985 Джеф Ли опубликовал написанную им грамматику для системы yacc (авместе с соотвествующей Lex спецификацией), которая 30 Апредя 1985 стала черновой версией стандарта ANSI C. Том Стокфтш разместил ее на net.sources в 1987. Оригинал доступен по ссылке usenet/net.sources/ansi.c.grammar.Z.

Jutta Degener, 1995 Прочитать остальную часть записи »

VN:F [1.9.11_1134]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.11_1134]
Rating: 0 (from 2 votes)

Про Масала-Чай.

13.10.2010

Ведическая культура Индии вошла в мою жизнь очень тихо. Мягко ступая, она принесла свои ароматы, традиции, познания природы вещей и людей. В настоящее время очень много людей интересуются Индийскими традициями. Теперь много доступно разнообразной литературы, и после прочтения можно самим убедиться воочию в красоте и практичности тех или иных рекомендаций, которые выдержали испытания временем. Прочитать остальную часть записи »

VN:F [1.9.11_1134]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.11_1134]
Rating: +1 (from 1 vote)

Efficient Editing With vim

22.08.2010

Efficient Editing With vim

Translations of this article are available in German (Effiziente Textbearbeitung mit Vim), French (L’�dition efficace avec vim), Italian (Vim e Gvim: usarli in modo efficiente, and Chinese (高效使用vim).


«To me, vi is Zen.
To use vi is to practice zen.
Every command is a koan.
Profound to the user,
unintelligible to the uninitiated.
You discover truth every time you use it.»
--reddy@lion.austin.com

This tutorial assumes a basic knowledge of vim — insert mode, command mode, loading and saving files, etc. It is intended to help vi novices develop their skills so that they can use vi efficiently.

In this tutorial, <C-X> means Ctrl-X — that is, hold down the Ctrl key and press X. You can get help on most of the commands used here by typing :help command in vim, where command is what you need help on.

Moving efficiently

Stay out of insert mode

In general, you want to spend as little of your time in vim’s insert mode as possible, because in that mode it acts like a dumb editor. This is why most vim novices spend so much time in insert mode — it makes vim easy to use. But vim’s real power lies in command mode! You’ll find that the better you know vim, the less time you will spend in insert mode. Прочитать остальную часть записи »

VN:F [1.9.11_1134]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.11_1134]
Rating: 0 (from 0 votes)