next up previous contents
Next: The MEKO-grammar Up: The Fib-grammar Previous: Compiling the grammar

Running the parser

The Fib-parser is invoked by the command fib. Let's run the parser with the following options:

fib -pbv
instructing the parser to use prefix parsing, to produce labeled bracket output and to show its settings.

First, the parser displays its settings:

Using prefix parsing
Word separators are ' <TAB><NL>,.?;:()!"'
Invisible characters are ' <TAB><NL>'
Disfavouring wildcards
Full memoization available
>>

The >>-prompt indicates that the parser is ready to accept input. You can for example type:

aaaaaaa
yielding thirteen parses:
fib{"a",{fib{"a",{fib{"a",{fib{"a",{fib{"a",{fib{"a",{}}}}}}}}}}}}
fib{"a",{fib{"a",{fib{"a",{fib{"a",{fib{"aa",{}}}}}}}}}}
fib{"a",{fib{"a",{fib{"a",{fib{"aa",{fib{"a",{}}}}}}}}}}
fib{"a",{fib{"a",{fib{"aa",{fib{"a",{fib{"a",{}}}}}}}}}}
fib{"a",{fib{"a",{fib{"aa",{fib{"aa",{}}}}}}}}
fib{"a",{fib{"aa",{fib{"a",{fib{"a",{fib{"a",{}}}}}}}}}}
fib{"a",{fib{"aa",{fib{"a",{fib{"aa",{}}}}}}}}
fib{"a",{fib{"aa",{fib{"aa",{fib{"a",{}}}}}}}}
fib{"aa",{fib{"a",{fib{"a",{fib{"a",{fib{"a",{}}}}}}}}}}
fib{"aa",{fib{"a",{fib{"a",{fib{"aa",{}}}}}}}}
fib{"aa",{fib{"a",{fib{"aa",{fib{"a",{}}}}}}}}
fib{"aa",{fib{"aa",{fib{"a",{fib{"a",{}}}}}}}}
fib{"aa",{fib{"aa",{fib{"aa",{}}}}}}

all:     13     (prescan: 0.005 s., parsing: 0.002 s., printing: 0.024 s. )

>>

The >>-prompt is displayed again. You can type another sentence or exit the parser by pressing just the return-key. We do the latter, and start the parser again with the following options:

  fib -pG -P 0 -l "[|]"
instructing the parser use prefix parsing, to show the lexical network for each sentence, to suppress parsing and to accept lists of words on single word positions.

Now typing

[a|aa]aa
yields:
Lexical graph:
 1 "a" 7
 1 "aa" 7
 7 "aa" 9
 7 "a" 8
 8 "a" 9
 9 $EOS$
Notice that the network is indexed with character positions, because prefix parsing was used.




2000-01-10