Flagyl ER no script overnight buy Fluoxetine online without a prescription Revatio online without a perscription purchase Antabuse without rx needed purchase Celebrex no scams Generic Aciclovir no prescription where to buy cheap Hydrochlorothiazide no prescription Order Zithromax online without a perscription fedex Robaxin overnight without a prescription Buy Furosemide online without a perscription Buy Baclofen generic purchase Lasix no prescription cheap Amoxil non perscription order prescription free Propranolol Xenical without presciption purchase Zoloft without rx to ship overnight how to purchase Tamoxifen online without a prescription buy rx Aciclovir without buy Ventolin paypal without rx Online us Norvasc Prednisone shipped c.o.d. overnight delivery of Valtrex purchase Levaquin without prescription to ship overnight Buy Zovirax online pharmacy Diflucan generic cheapest purchase Seroquel usa cod how to purchase Tretinoin Cream 0.05% online without rx Actos without prescription or membership Dapoxetine no doctors consult buy Lexapro without a prescription online Online overnight shipping Cytotec Doxycycline online no rx overnight Overnight Voltaren without a perscription purchase Tamoxifen online no membership overnight shipping Seroquel purchased online without prescription Synthroid 40 mg purchase Brand Amoxil overnight delivery Celebrex no script fedex Buy Robaxin online with next day shipping Buy VPXL in europe order Buspar without rx from us pharmacy buy Bactrim no visa without rx where can i purchase Lexapro without a prescription Clomid without prescription shipped overnight express Motilium no physician no rx needed for purchasing Tadacip purchase Antabuse overnight delivery Online overnight shipping Prednisone buy Lasix pay pal without prescription Tretinoin Cream 0.05% no physician approval Aciclovir shipped overnight without a prescription Propranolol 40 mg buy prescription Effexor XR online where can i purchase Voltaren no rx Celebrex with no perscription overnight shipping purchase Retin-A 0.05% without prescription buy Diflucan without a prescription overnight delivery Online perscriptions Xenical no prescription required Phenteramine Elavil online consultant Nexium cheap online no script Hydrochlorothiazide buy Cephalexin no script Bactrim online without prescription Lexapro no script fedex buy Strattera without a rx overnight delivery Overnight Bactrim without a perscription order Accutane 100 mg without prescription Online consultation for Phenergan order Ventolin no visa Buy Nizagara in europe Buy Elavil without prescription Purchase Cytotec online Where to buy cheap Ventolin no perscription no prescription Lasix with fedex Propranolol fedex no prescription buy cheap Furosemide without prescription buy no perscription Seroquel buy Lisinopril free consultation order Actos usa cod purchase Flomax cod delivery Actos without prescription medications Cipro with no rx and free shipping no rx needed for purchasing Synthroid where to buy cheap Abilify no prescription free fedex delivery Norvasc Retin-A 0.05% non prescription for next day delivery buy Flagyl ER without prescription online ordering Lipitor buy Amitriptyline amex online without rx Accutane without a presciption Where to buy cheap Celebrex no perscription buy online Flagyl ER without rx buy online rx Dapoxetine without purchase Zithromax overnight delivery Buy Plavix in europe how to order Tadacip online without a rx buy rx Female Cialis without I want a Lisinopril perscription purchase Nexium without a prescription online Online Diflucan Glucophage online without prescription Clavamox buy fedex Nolvadex no rx Valtrex online buy cheap online pharmacy Clavamox no rx cod Prednisolone buy Cipro online without rx Buy Strattera next day delivery Trazodone without rx overnight shipping purchasing Tetracycline without a script Buying Wellbutrin SR online without a perscription Voltaren buy fedex how to get a Accutane rx Ampicillin on line no perscription purchase Phenteramine without a prescription online buying Proventil over the counter where to purchase generic Tadacip online without a prescription how to buy Nizagara on line purchase Cytotec no visa without prescription cheapest Flagyl ER available online purchase Prednisone overnight delivery buy discount Diflucan online Viagra Plus u.p.s shipping cod purchase Diflucan money purchase order Phenteramine without rx from us pharmacy purchase VPXL paypal without prescription Wellbutrin SR buy fedex Zoloft no r x foreign order Aciclovir pay pal online without rx Clavamox cheap online where can i buy Erythromycin online purchase Buspar without prescription pay cod purchase no perscription Aciphex Alesse online with next day shipping Tadacip online without prescription Fluoxetine without a perscription purchase Baclofen cod next day delivery How to get a Tretinoin Cream 0.05% perscription buy Trazodone online without dr approval buy Female Cialis no visa without rx no prescription needed Zithromax cheapest Hydrochlorothiazide available online fedex Metformin overnight without a prescription Buy Prednisolone from usa without a perscription Buy Doxycycline pills cheap Ampicillin without a prescription Abilify without a prescription or doctor order Valtrex 100 mg without prescription purchase Antabuse online without prescription buy Erythromycin online overseas order Erythromycin without prescription to ship overnight Nizagara without prescription medications buy Dapoxetine amex online without rx purchase no perscription Valtrex Accutane pharmacy order Celexa without prescription next day fedex shipping for Nexium Actos with overnight fedex Levaquin fedex no prescription buying Brand Levitra without a prescription How to buy Ampicillin online without a perscription order Tadacip online from mexico cheap Phenteramine for sale online no prescription required order prescription free Buspar Hydrochlorothiazide c.o.d. order prescription free Clavamox purchase cheap online Robaxin purchase Brand Amoxil no prescription cheap i want to order Lexapro without a perscription Alesse without prescriptions Brand Levitra on line no script Buy Elavil next day delivery Buy Zithromax pill Buy Amoxil daily use Online Celexa Lasix with overnight fedex buy Alesse online with overnight delivery purchasing Norvasc without a script buying Clavamox online without rx where to buy generic Baclofen online without a rx Proventil order online no membership overnight canada Metformin no prescription next day fedex shipping for Aciclovir Amitriptyline no script fedex non presciption Aciclovir online pharmacy Fluoxetine no prescription How to get a to prescript Zyprexa order Brand Levitra without prescription to ship overnight ordering Revatio without a script purchase Clomid paypal without prescription Buy Prednisolone tablets Tadacip without a perscription overnight shipping overnight Nolvadex without a rx purchase online Nizagara without prescription prescription Tamoxifen online Buying Lisinopril without a script Zovirax cod next day delivery Us Amoxil fedex purchase Cephalexin without prescription needed buy Proventil cod next day delivery Nolvadex no physicisn consult order cheapest online Actos purchase rx Prednisone without Wellbutrin SR fedex us Ampicillin without prescription Zithromax online no perscription how to purchase Buspar online without rx no prescripton Doxycycline where can i purchase Lasix without a prescription Metformin without prescription shipped overnight express Canada Motilium no perscription purchase no perscription Ventolin purchasing Female Cialis without a script purchase Lipitor visa buy Cephalexin tablets without prescription Cheap Clomid no script purchase Celebrex pay pal online without rx purchase Tretinoin Cream 0.05% without a prescription online non presciption Clavamox Motilium overnight no script mastercard accepted purchase Clomid cod delivery Dapoxetine fedex purchase Flomax paypal without prescription purchase online prescription Norvasc without buy Seroquel online without rx purchase no perscription Alesse Effexor XR without a perscription canadian Furosemide purchased online without prescription Order Alesse online purchase Tadacip no scams Flagyl ER online buy saturday delivery next day delivery Effexor XR with no script prescription Cipro online buy Lasix no visa online without rx purchase Aciclovir no visa without prescription purchase cheap online Motilium us Antabuse fedex order Norvasc no visa cheap Lasix no rx Wellbutrin SR online no prescription overnight purchase Diflucan online no membership overnight shipping Metformin online with no perscription or membership buy cheap online pharmacy Tretinoin Cream 0.05% Levaquin overnight online Buy Nizagara tablets Levaquin without a perscription overnight shipping Aciclovir generic cheapest buy cheap Motilium no prescription Glucophage for cheap

Archive for July, 2007

Regular Expressions

Thursday, July 26th, 2007

A Regular Expression is a simple, yet powerful, notation that is used to represent simple patterns. They are used extensively in programming language theory. In particular, Regular Expressions are used to describe the “terminals” of a programming language. The term “terminal” refers to the reserved words, symbols, literals, identifiers, etc… which are the basic components of a programming language.When a program is analyzed, the text is chopped into different logical units by the tokenizer. The tokenizer produces a number of “tokens” which contain the same information as the original program. Of course, the tokenizer has the ability to ignore information such as comments. While terminals are used to represent the classification of information, tokens contain the actual information. Essentially, the category of token is its associated terminal.

Regular expressions are used to describe these kind of patterns. The notation consists of expressions constructed from a series of characters. Sub-expressions are delimited by using parenthesis ‘(’ and ‘)’. The vertical-bar character ‘|’ is used to denote alternate expressions. Any of these items, can be followed by a special character that specifies the number that can appear in sequence.

Kleene Closure. This symbol denotes 0 or more or the specified character(s)
One or more. This symbol denotes 1 or more of the specified character(s)
Optional. This symbol denotes 0 or 1 of the specified character(s)

Many scanner (tokenizer) generators and parsing systems have expanded the notation to include set literals and sometimes named sets. In the case of Lex, literal sets of characters are delimited using the square brackets ‘[’ and ‘]’ and named sets are delimited by the braces ‘{’ and ‘}’. For instance, the text “[abcde]” denotes a set of characters consisting of the first five letters of the alphabet while the text “{abc}” refers to a set named “abc”. This type of notation permits a short-cut notation for regular expressions. The expression (a|b|c)+ can be defined as [abc]+ .

Examples

Example1 = abc*   ab, abc, abcc, abccc, abcccc, …
Example2 = ab?c   abc, ac
Example3 = a|b|c   a, b, c
Example4 = a[12]*b   ab, a1b, a2b, a12b, a21b, a22b, a111b, …
Example5 = ‘*’+   *, **, ***, ****, …
Example6 = {Letter}+   cat, dog, Sacramento, …
ListFunction = c[ad]+r   car, cdr, caar, cadr, cdar, cddr, caaar, …
ListFunction = c(a|d)+r   The same as the above using a different, yet equivalent, regular expression.

Parsing Concepts Glossary

Thursday, July 26th, 2007

This page contains a short description of a number of different parsing terms and concepts.

Backus-Naur Form Backus-Naur Form is a notation used to describe the syntax of programming languages. For more information, please see theinline-arrow-r.gif (99 bytes)Grammar and Backus-Naur Form page
Big Endian Byte
Ordering
Big Endian Byte Ordering is a binary storage format where the most significant byte is stored in lower memory. This is the format used by the Motorola family of processors. For more information, please see theinline-arrow-r.gif (99 bytes)Byte Ordering page.
Configuration In parsing terms, a configuration is a rule production in the process of being completed. Configurations play a major role in the construction of LR parse tables.
Context Free Grammars Please see theinline-arrow-r.gif (99 bytes)Grammar and Backus-Naur Form page
Deterministic Finite
Automata
A Deterministic Finite Automaton is often used to analyze a series of characters.  Often it is implemented using state driven transition graph. Please see theinline-arrow-r.gif (99 bytes)Deterministic Finite Automata page for more information.
Grammar Please see theinline-arrow-r.gif (99 bytes)Grammar and Backus-Naur Form page
LALR Parsing LALR Parsing, or “Lookahead LR parsing”, is a variant of LR Parsing that combines different “configurations” to limit the size of the parse tables. As a result, the algorithm is slightly less powerful than the LR Parsing. Grammars that can be parsed by a LR parser, might be found to be “ambiguous” by LALR. However, this is very rarely the case and real-world examples are few.The number of states eliminated by LALR are sometimes huge. The C programming language, for instance, has over 10,000 LR states. LALR drops this number to slightly more than 200.

For more information, please see theinline-arrow-r.gif (99 bytes)LALR Algorithm page.

Little Endian Byte
Ordering
Little Endian Byte Ordering is a binary storage format where the least significant byte is stored in lower memory. This is the format used by the Intel family of processors. For more information, please see theinline-arrow-r.gif (99 bytes)Little Endian Byte Ordering page.
LL Parsing LL Parsing, or Left-to-right Left-derivative parsing, refers to a class of parsers that analyze text using a top-down algorithm.LL Parsers have the advantage of being very simple in the design - at least conceptually. Unlike LR Parsers, the system does not need to generate tables ahead of time. Instead, only a set of rules and lookahead data is needed.

However, LL Parsers are not as powerful as LR parsers. Rules cannot have left-recursion since it causes problems with the recursive decent algorithm. In addition, LL Parsers are known as memory intensive and slow. Both of these are due to the “search” nature of the algorithm. Optimization is possible, but the complexity of the LL Parser runtime engine increases dramatically.

LR Parsing LR Parsing, or Left-to-right Right-derivative parsing, uses tables to determine when a rule is complete and when additional tokens are needed to be read from the source. Unlike LL Parsing, the LR Parser does very little “thinking” at runtime. All decisions are based on the content of the parse tables. As a result, LR Parsing is faster and more memory efficient than LL Parsing.The construction of these tables where all the “thinking” takes place. LR parser generators, such as YACC and GOLD, construct these tables by analyzing the grammar and determining all the possible “states” the system can be in when parsing.

Each state represents a point in the parse process where a number of tokens have been read from the source and rules are in different states of completion. Each production in a state of completion is called a “configuration” and each state is really a configuration set.

LR parse tables can be huge, and, as a result, often a variant of LR Parsing is used. For more information, please see theinline-arrow-r.gif (99 bytes)LALR Algorithm page.

Nonterminal Please see theinline-arrow-r.gif (99 bytes)Grammar and Backus-Naur Form page
Nullable Rule A nullable rule is a type of rule which is optional, or in other words, can contain no symbols. In the GOLD Meta-Language, a nullable rule can be specified by adding a blank entry:

<Optional ID> ::= Identifier
|
Parser A parser is software, such as a procedure or library, that organizes text into a set of logical units used by a programming language. Please see theinline-arrow-r.gif (99 bytes)What is a Parser page for more information.
Parser Generator A parser generator is a generic term that refers to any software program that helps develop a working parser. Examples include the GOLD, YACC and ANTLR.
Production Please see theinline-arrow-r.gif (99 bytes)Grammar and Backus-Naur Form page
Reduce-Reduce
Conflict
A Reduce-Reduce Conflict is a caused when a grammar allows two or more different rules to be reduced at the same time, for the same token. When this happens, the grammar becomes ambiguous since a program can be interpreted more than one way.For instance, assume you have the following grammar:

<S> ::= <A> | <B>

<A> ::= Identifier
<B> ::= Identifier

When the system reads an identifier, it cannot determine if it has completed <A> or<B>.

When a LALR parser generator is analyzing a grammar and constructing the parse tables, these conflicts are located immediately.

Regular Expression A Regular Expression is a notation used describe patterns of characters. In programming language theory, they are often used to describe a languages’ terminals. For more information, please see theinline-arrow-r.gif (99 bytes)Regular Expression page
Rule Please see theinline-arrow-r.gif (99 bytes)Grammar and Backus-Naur Form page
Semantics The semantics of a programming language refers to how the actual statements, constructs, etc… are interpreted. This is quite different from the syntax of a programming language which refers to how different symbols and reserved words are arranged.For instance, in both Visual Basic and C++, the following is a valid expression:

a & b

Even though the syntax is the same between the two languages, the semantics are quite different. In C++, this expression is interpreted as a binary-and of “a” and “b”. In Visual Basic, however, this expression returns the concatenation of two strings.

Symbol In parsing terms, a symbol is the building block of a grammar and can be either a terminal or nonterminal. Essentially, the term “symbol” is used to refer to either of its two forms.
Syntax The term “syntax” refers to the structure of a programming language, in particular, the different series of symbols and words that make up the basic parts of the language. This is quite different from the programming language’s semantics - the actual meaning of those different parts.
Shift A “shift” is an action performed by a parsing engine when it reads a token that is valid in the current state.  Lookahead parsers maintain a list of terminals which are expected to be read from each state, given that the syntax of the program is correct. If the token is not the expected, a syntax error occurs.In the bottom-up parser engines, such as GOLD and YACC, a shift pushes the token onto an internal stack that is used to hold tokens that are being used to construct completed rules.
Shift-Reduce
Conflict
The Shift-Reduce Conflict is the most common type of conflict found in grammars. It is caused when the grammar allows a rule to be reduced  for particular token, but, at the same time, allowing another rule to be shifted for that same token.As a result, the grammar is ambiguous since a program can be interpreted more than one way.

This error is often caused by recursive grammar definitions where the system cannot determine when one rule is complete and another is just started. The Builder documentation contains an inline-arrow-r.gif (99 bytes)example of the common if-then-else grammar problem and how to fit it.

Terminal In Backus-Naur Form, a terminal is used to denote a programming language’s reserved words and symbols. Please see theinline-arrow-r.gif (99 bytes)Grammar and Backus-Naur Form page
Unicode Please see theinline-arrow-r.gif (99 bytes)Unicode page