These graphs can be used to express the grammar of the
language.
A GRAMMAR is a finite set of productions which contain terminal
or non-terminal strings.
If there is at least one step in a derivation n >= 1 thenn is eventually derived from
0.
If n >= 0, i.e. perhaps no steps in derivation thenn is derived from
0.
A sentence is a sentential form which only contains
terminal symbols.
import local.units.sdsu.io.*;
public class Hello
{
public static void main(String argv[])
{
Format.print(System.out,"Hello\n");
}
}
The wombat eats the fish.
Term symbol use Meaning
Directly derived =>0=>
n in one step
eventually derived =>+0=>+
n in one or more steps
derived =>*0=>*
n zero or more steps
sentential form S =>*n
In fact, programs exist which churn out a "front end"
or syntax checker for a particular language.
YACC is a compiler Compiler. Context free grammar is
used to produce a C or Fortran program which contains
routines to analyse the syntax of language. YACC can
handle ambiguous structures. Uses user defined precedence.
Although for following, we have two rules:
(1) First symbol(each branch)i = First symbol(each branch)j i != j
(2) If we can traverse a graph without getting a new symbol,
we must "know" what symbols may follow.