-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjezebel-iglr.el
65 lines (47 loc) · 1.25 KB
/
jezebel-iglr.el
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
;; -*- lexical-binding: t -*-
;; Fully incremental GLR parser for Jezebel editing environments.
;; Based on the IGLR algorithm in Tim A. Wagner's "Practical
;; Algorithms for Incremental Software Development Environments"
(require 'jezebel-util)
(require 'jezebel-lr)
(cl-defstruct jez-iglr-node
;; production or symbol #
type
;; deterministic parse state or noState
state
;; setof NODE kids: rhs of a production; interpretations of a symbol
kids)
(cl-defstruct (jez-iglr-symbol (:include jez-iglr-node))
)
(cl-defstruct jez-iglr-gss-node
;; state of constructing parser
state
;; setof LINK links; links to earlier nodes
links)
(cl-defstruct jez-iglr-gss-link
;; preceding node in the GSS
head
;; parse dag node labeling this edge
node)
(cl-defstruct jez-iglr-state
;; bool multipleStates
multiple-states
;; lookahead symbol (subtree)
shift-la
;; lookahead for reducing
red-la
;; GSS_NODE acceptingParser
accepting-parser
active-parsers
for-actor
for-shifter
;; production node merge table
nodes
;; symbol node merge table
symbol-nodes
;; parse-table
parse-table)
(defun jez-iglr-parse-incremental (iglr root)
(jez-iglr-process-modifications-to-parse-dag root)
)
(provide 'jezebel-iglr)