blob: b525f8fab580fc553efa41eccfc0b6cd81d68614 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Quickstart Guide - Packrat Docs</title>
<link href="default.css" rel="stylesheet">
</head>
<body>
<h2>Quickstart Guide</h2>
<a href="index.html">Return to Contents</a>
<h4>Lexing and Parsing</h4>
<p>The package that you will need is <em>Packrat.Standard</em>. If you are parsing
ordinary strings then <em>Packrat.Utilities</em> may also be useful.<br>
<br>
Define enumeration types for all the lexer token labels and parse graph node labels
you need, then use them to instantiate <em>Packrat.Standard</em>.<br>
<br>
Instantiate subprograms from the nested <em>Lexers</em> package to create your lexer,
and subprograms from the nested <em>Parsers</em> package to create your parser.<br>
<br>
Take special care when using any redirects from <em>Parsers</em>. They are used to
allow for self-referential instantiation of parser combinators and must be set properly
before using any parsers built with them. Otherwise an exception will be raised.<br>
<br>
Feed your input through the lexer, then the results of that through the parser to
obtain a parse graph.<br>
<br>
Use subprograms from the nested <em>Parse_Graphs</em> package to inspect and manipulate
the resulting graph.
</p>
<h4>Parsing Only</h4>
<p>The package that you will need is <em>Packrat.No_Lex</em>. If you are parsing
ordinary strings then <em>Packrat.Utilities</em> may also be useful.<br>
<br>
Define an enumeration type for all the parse graph node labels you need, then use it
to instantiate <em>Packrat.No_Lex</em>.<br>
<br>
Instantiate subprograms from the nested <em>Parsers</em> package to create your parser.<br>
<br>
Take special care when using any redirects. They are used to allow for self-referential
instantiation of parser combinators and must be set properly before using any parsers
built with them. Otherwise an exception will be raised.<br>
<br>
Feed your input through the parser to obtain a parse graph.<br>
<br>
Use subprograms from the nested <em>Parse_Graphs</em> package to inspect and manipulate
the resulting graph.
</p>
</body>
</html>
|