Τρίτη, 20 Μαρτίου 2012

Grammar - BNF and parsers

from stackoverflow:
If you are doing parsing, the way to go is a BNF grammar. Constructing one and using it will be a very good learning exercise.



copy paste from wikipedia: 
In computer scienceBNF (Backus Normal Form or Backus–Naur Form) is one of the two [1] main notation techniques for context-free grammars, often used to describe the syntax of languages used in computing, such as computer programming languagesdocument formatsinstruction sets and communication protocol; the other main technique for writing context-free grammars is the van Wijngaarden form. They are applied wherever exact descriptions of languages are needed: for instance, in official language specifications, in manuals, and in textbooks on programming language theory.
Many extensions and variants of the original Backus–Naur notation are used; some are exactly defined, including Extended Backus–Naur Form (EBNF) and Augmented Backus–Naur Form (ABNF).


to be continue... 

Δεν υπάρχουν σχόλια:

Δημοσίευση σχολίου