Initial Commit
[packages] / xemacs-packages / semantic / bovine / semantic-erlang-by.el
1 ;;; semantic-erlang-by.el --- Generated parser support file
2
3 ;; Copyright (C) 2002, 2003 Vladimir G. Sekissov
4
5 ;; Author: Eric M. Ludlam <zappo@projectile.siege-engine.com>
6 ;; Created: 2007-06-05 21:47:08-0400
7 ;; Keywords: syntax
8 ;; X-RCS: $Id: semantic-erlang-by.el,v 1.1 2007-11-26 15:11:55 michaels Exp $
9
10 ;; This file is not part of GNU Emacs.
11 ;;
12 ;; This program is free software; you can redistribute it and/or
13 ;; modify it under the terms of the GNU General Public License as
14 ;; published by the Free Software Foundation; either version 2, or (at
15 ;; your option) any later version.
16 ;;
17 ;; This software is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20 ;; General Public License for more details.
21 ;;
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
26
27 ;;; Commentary:
28 ;;
29 ;; PLEASE DO NOT MANUALLY EDIT THIS FILE!  It is automatically
30 ;; generated from the grammar file erlang.by.
31
32 ;;; History:
33 ;;
34
35 ;;; Code:
36 \f
37 ;;; Prologue
38 ;;
39 \f
40 ;;; Declarations
41 ;;
42 (defconst semantic-erlang-by--keyword-table
43   (semantic-lex-make-keyword-table
44    '(("begin" . BEGIN)
45      ("end" . END)
46      ("case" . CASE)
47      ("of" . OF)
48      ("if" . IF)
49      ("when" . WHEN)
50      ("true" . TRUE)
51      ("receive" . RECEIVE)
52      ("after" . AFTER)
53      ("or" . OR)
54      ("orelse" . ORELSE)
55      ("xor" . XOR)
56      ("bor" . BOR)
57      ("bxor" . BXOR)
58      ("bsl" . BSL)
59      ("bsr" . BSR)
60      ("div" . DIV)
61      ("rem" . REM)
62      ("band" . BAND)
63      ("and" . AND)
64      ("andalso" . ANDALSO)
65      ("bnot" . BNOT)
66      ("not" . NOT)
67      ("catch" . CATCH)
68      ("fun" . FUN)
69      ("query" . QUERY)
70      ("let" . LET)
71      ("module" . MODULE)
72      ("include" . INCLUDE)
73      ("include_lib" . INCLUDE_LIB)
74      ("behaviour" . BEHAVIOUR)
75      ("define" . DEFINE)
76      ("undef" . UNDEF)
77      ("ifdef" . IFDEF)
78      ("ifndef" . IFNDEF)
79      ("else" . ELSE)
80      ("endif" . ENDIF)
81      ("export" . EXPORT)
82      ("import" . IMPORT)
83      ("record" . RECORD)
84      ("signed" . SIGNED)
85      ("unsigned" . UNSIGNED))
86    'nil)
87   "Table of language keywords.")
88
89 (defconst semantic-erlang-by--token-table
90   (semantic-lex-make-type-table
91    '(("close-paren"
92       (RBRACE . "}")
93       (RPAREN . ")"))
94      ("open-paren"
95       (LBRACE . "{")
96       (LPAREN . "("))
97      ("semantic-list"
98       (BRACE_BLCK . "^{")
99       (BRACK_BLCK . "^\\[")
100       (PAREN_BLCK . "^("))
101      ("symbol"
102       (UNIT . "unit")
103       (NATIVE . "native")
104       (LITTLE . "little")
105       (BIG . "big")
106       (BINARY . "binary")
107       (FLOAT . "float")
108       (INTEGER . "integer")
109       (FILE . "file")
110       (USCORE . "_")
111       (VAR2 . "^[A-Z][_a-zA-Z0-9]*")
112       (VAR1 . "^_[a-zA-Z0-9]+")
113       (INT2 . "[0-9]\\{1,2\\}")
114       (INT1 . "[0-9a-eA-E]+")
115       (EE . "[eE]")
116       (DIGITS . "[0-9]+")
117       (ATOM2 . "'.+'")
118       (ATOM1 . "[a-z][a-zA-Z0-9_@]*"))
119      ("punctuation"
120       (SIGN . "[-+]")
121       (VDEL . "\\`[|]\\'")
122       (COMA . "\\`[,]\\'")
123       (GREATER . "\\`[>]\\'")
124       (LESS . "\\`[<]\\'")
125       (EQUAL . "\\`[=]\\'")
126       (WHY . "\\`[?]\\'")
127       (BANG . "\\`[!]\\'")
128       (MINUS . "\\`[-]\\'")
129       (PLUS . "\\`[+]\\'")
130       (DIVIDE . "\\`[/]\\'")
131       (AMPERSAND . "\\`[&]\\'")
132       (STAR . "\\`[*]\\'")
133       (SEMICOLON . "\\`[;]\\'")
134       (COLON . "\\`[:]\\'")
135       (PERIOD . "\\`[.]\\'")
136       (HASH . "\\`[#]\\'")))
137    'nil)
138   "Table of lexical tokens.")
139
140 (defconst semantic-erlang-by--parse-table
141   `(
142     (bovine-toplevel 
143      (module-decl)
144      ) ;; end bovine-toplevel
145
146     (add-op
147      (punctuation
148       "\\`[+]\\'")
149      (punctuation
150       "\\`[-]\\'")
151      (BOR)
152      (BXOR)
153      (BSL)
154      (BSR)
155      ) ;; end add-op
156
157     (list-conc-op
158      (punctuation
159       "\\`[+]\\'"
160       punctuation
161       "\\`[+]\\'")
162      (punctuation
163       "\\`[-]\\'"
164       punctuation
165       "\\`[-]\\'")
166      ) ;; end list-conc-op
167
168     (comp-op
169      (punctuation
170       "\\`[=]\\'"
171       punctuation
172       "\\`[=]\\'"
173       ,(semantic-lambda
174         (list
175          "=="))
176       )
177      (punctuation
178       "\\`[=]\\'"
179       punctuation
180       "\\`[:]\\'"
181       punctuation
182       "\\`[=]\\'"
183       ,(semantic-lambda
184         (list
185          "=:="))
186       )
187      (punctuation
188       "\\`[=]\\'"
189       punctuation
190       "\\`[/]\\'"
191       punctuation
192       "\\`[=]\\'"
193       ,(semantic-lambda
194         (list
195          "=/="))
196       )
197      (punctuation
198       "\\`[/]\\'"
199       punctuation
200       "\\`[=]\\'"
201       ,(semantic-lambda
202         (list
203          "/="))
204       )
205      (punctuation
206       "\\`[=]\\'"
207       punctuation
208       "\\`[<]\\'"
209       ,(semantic-lambda
210         (list
211          "=<"))
212       )
213      (punctuation
214       "\\`[>]\\'"
215       punctuation
216       "\\`[=]\\'"
217       ,(semantic-lambda
218         (list
219          ">="))
220       )
221      (punctuation
222       "\\`[<]\\'")
223      (punctuation
224       "\\`[>]\\'")
225      (OR)
226      (ORELSE)
227      (XOR)
228      (AND)
229      (ANDALSO)
230      ) ;; end comp-op
231
232     (multi-op
233      (punctuation
234       "\\`[*]\\'")
235      (punctuation
236       "\\`[/]\\'")
237      (DIV)
238      (REM)
239      (BAND)
240      ) ;; end multi-op
241
242     (prefix-op
243      (punctuation
244       "\\`[+]\\'")
245      (punctuation
246       "\\`[-]\\'")
247      (BNOT)
248      (NOT)
249      ) ;; end prefix-op
250
251     (basic-type
252      (float-literal)
253      (integer-literal)
254      (char-literal)
255      (atom)
256      (var)
257      (string)
258      (TRUE)
259      ) ;; end basic-type
260
261     (atom
262      (symbol
263       "[a-z][a-zA-Z0-9_@]*"
264       ,(semantic-lambda
265         (list
266          (nth 0 vals)))
267       )
268      (symbol
269       "'.+'"
270       ,(semantic-lambda
271         (list
272          (nth 0 vals)))
273       )
274      ) ;; end atom
275
276     (float-literal
277      (symbol
278       "[0-9]+"
279       punctuation
280       "\\`[.]\\'"
281       symbol
282       "[0-9]+"
283       exp-part)
284      (punctuation
285       "\\`[.]\\'"
286       symbol
287       "[0-9]+"
288       exp-part)
289      ) ;; end float-literal
290
291     (exp-part
292      (symbol
293       "[eE]"
294       punctuation
295       "[-+]"
296       symbol
297       "[0-9]+")
298      (symbol
299       "[eE]"
300       symbol
301       "[0-9]+")
302      ( ;;EMPTY
303       )
304      ) ;; end exp-part
305
306     (integer-literal
307      (symbol
308       "[0-9a-eA-E]+")
309      (symbol
310       "[0-9]\\{1,2\\}"
311       punctuation
312       "\\`[#]\\'"
313       symbol
314       "[0-9a-eA-E]+")
315      ) ;; end integer-literal
316
317     (char-literal
318      (CHAR)
319      ) ;; end char-literal
320
321     (var
322      (symbol
323       "^_[a-zA-Z0-9]+"
324       ,(semantic-lambda
325         (semantic-tag-new-variable
326          (nth 0 vals) nil nil))
327       )
328      (symbol
329       "^[A-Z][_a-zA-Z0-9]*"
330       ,(semantic-lambda
331         (semantic-tag-new-variable
332          (nth 0 vals) nil nil))
333       )
334      ) ;; end var
335
336     (uni-pattern
337      (symbol
338       "_")
339      ) ;; end uni-pattern
340
341     (binary
342      (punctuation
343       "\\`[<]\\'"
344       punctuation
345       "\\`[<]\\'"
346       punctuation
347       "\\`[>]\\'"
348       punctuation
349       "\\`[>]\\'"
350       ,(semantic-lambda
351         (semantic-tag
352          "<<>>"
353          'binary))
354       )
355      (punctuation
356       "\\`[<]\\'"
357       punctuation
358       "\\`[<]\\'"
359       binary-segments
360       punctuation
361       "\\`[>]\\'"
362       punctuation
363       "\\`[>]\\'"
364       ,(semantic-lambda
365         (semantic-tag
366          "<<Binary>>"
367          'binary))
368       )
369      ) ;; end binary
370
371     (binary-segments
372      (binary-segment
373       binary-segments-rest)
374      ) ;; end binary-segments
375
376     (binary-segments-rest
377      (punctuation
378       "\\`[,]\\'"
379       binary-segments
380       ,(semantic-lambda
381         (nth 1 vals))
382       )
383      ( ;;EMPTY
384       )
385      ) ;; end binary-segments-rest
386
387     (binary-segment
388      (basic-type
389       binary-segment-rest)
390      (clause-pattern
391       binary-segment-rest)
392      ) ;; end binary-segment
393
394     (binary-segment-rest
395      (punctuation
396       "\\`[:]\\'"
397       basic-type
398       punctuation
399       "\\`[/]\\'"
400       binary-type-spec-list)
401      (punctuation
402       "\\`[:]\\'"
403       basic-type)
404      (punctuation
405       "\\`[/]\\'"
406       binary-type-spec-list)
407      ( ;;EMPTY
408       )
409      ) ;; end binary-segment-rest
410
411     (binary-type
412      (symbol
413       "integer")
414      (symbol
415       "float")
416      (symbol
417       "binary")
418      ) ;; end binary-type
419
420     (binary-signed
421      (SIGNED)
422      (UNSIGNED)
423      ) ;; end binary-signed
424
425     (binary-endian
426      (symbol
427       "big")
428      (symbol
429       "little")
430      (symbol
431       "native")
432      ) ;; end binary-endian
433
434     (binary-unit
435      (symbol
436       "unit"
437       punctuation
438       "\\`[:]\\'"
439       basic-type)
440      ) ;; end binary-unit
441
442     (binary-type-spec
443      (binary-type)
444      (binary-signed)
445      (binary-endian)
446      (binary-unit)
447      ) ;; end binary-type-spec
448
449     (binary-type-spec-list
450      (binary-type-spec
451       punctuation
452       "\\`[-]\\'"
453       binary-type-spec-list)
454      (binary-type-spec)
455      ) ;; end binary-type-spec-list
456
457     (module-decl
458      (module-attr)
459      (function-decl)
460      (header-form)
461      (directive)
462      (file-attr)
463      ) ;; end module-decl
464
465     (module-attr
466      (punctuation
467       "\\`[-]\\'"
468       MODULE
469       semantic-list
470       "^("
471       full-stop
472       ,(semantic-lambda
473         (semantic-tag-new-package
474          (car
475           (semantic-bovinate-from-nonterminal
476            (car
477             (nth 2 vals))
478            (cdr
479             (nth 2 vals))
480            'module-attr-name)) nil))
481       )
482      ) ;; end module-attr
483
484     (module-attr-name
485      (open-paren
486       "("
487       module-name
488       close-paren
489       ")"
490       ,(semantic-lambda
491         (list
492          (car
493           (nth 1 vals))))
494       )
495      ) ;; end module-attr-name
496
497     (module-name
498      (atom
499       module-name-rest
500       ,(semantic-lambda
501         (list
502          (concat
503           (car
504            (nth 0 vals))
505           (car
506            (nth 1 vals)))))
507       )
508      (module-name-rest
509       ,(semantic-lambda
510         (list
511          (car
512           (nth 0 vals))))
513       )
514      ) ;; end module-name
515
516     (module-name-rest
517      (punctuation
518       "\\`[.]\\'"
519       atom
520       module-name-rest
521       ,(semantic-lambda
522         (list
523          (concat
524           (nth 0 vals)
525           (car
526            (nth 1 vals))
527           (car
528            (nth 2 vals)))))
529       )
530      ( ;;EMPTY
531       ,(semantic-lambda
532         (list nil))
533       )
534      ) ;; end module-name-rest
535
536     (header-form
537      (header-attr)
538      (anywhere-attr)
539      ) ;; end header-form
540
541     (header-attr
542      (export-attr)
543      (import-attr)
544      (compile-attr)
545      (whild-attr)
546      ) ;; end header-attr
547
548     (anywhere-attr
549      (file-attr)
550      (macro-def)
551      (record-decl)
552      ) ;; end anywhere-attr
553
554     (export-attr
555      (punctuation
556       "\\`[-]\\'"
557       EXPORT
558       semantic-list
559       "^("
560       full-stop)
561      ) ;; end export-attr
562
563     (export-name-list
564      (open-paren
565       semantic-list
566       "^\\["
567       close-paren)
568      ) ;; end export-name-list
569
570     (import-attr
571      (punctuation
572       "\\`[-]\\'"
573       IMPORT
574       semantic-list
575       "^("
576       full-stop
577       ,(semantic-lambda
578         (semantic-tag
579          (car
580           (semantic-bovinate-from-nonterminal
581            (car
582             (nth 2 vals))
583            (cdr
584             (nth 2 vals))
585            'import-name-list))
586          'import))
587       )
588      ) ;; end import-attr
589
590     (import-name-list
591      (open-paren
592       module-name
593       punctuation
594       "\\`[,]\\'"
595       semantic-list
596       "^\\["
597       close-paren
598       ,(semantic-lambda
599         (nth 1 vals)
600         (list
601          (semantic-bovinate-from-nonterminal
602           (car
603            (nth 3 vals))
604           (cdr
605            (nth 3 vals))
606           'function-name-list)))
607       )
608      (open-paren
609       module-name
610       close-paren
611       ,(semantic-lambda
612         (nth 1 vals))
613       )
614      ) ;; end import-name-list
615
616     (function-name-list
617      (open-paren
618       close-paren
619       ,(semantic-lambda
620         (list nil))
621       )
622      (open-paren
623       function-names
624       close-paren
625       ,(semantic-lambda
626         (list
627          (nth 1 vals)))
628       )
629      ) ;; end function-name-list
630
631     (function-names
632      (function-arity
633       punctuation
634       "\\`[,]\\'"
635       function-names
636       ,(semantic-lambda
637         (list
638          (nth 0 vals)
639          (nth 2 vals)))
640       )
641      (function-arity
642       ,(semantic-lambda
643         (list
644          (nth 0 vals)))
645       )
646      ) ;; end function-names
647
648     (function-arity
649      (atom
650       punctuation
651       "\\`[/]\\'"
652       integer-literal
653       ,(semantic-lambda
654         (nth 0 vals)
655         (list
656          (nth 1 vals))
657         (nth 2 vals))
658       )
659      ) ;; end function-arity
660
661     (compile-attr
662      (punctuation
663       "\\`[-]\\'"
664       COMPILE
665       semantic-list
666       "^("
667       full-stop)
668      ) ;; end compile-attr
669
670     (file-attr
671      (punctuation
672       "\\`[-]\\'"
673       symbol
674       "file"
675       semantic-list
676       "^("
677       full-stop)
678      ) ;; end file-attr
679
680     (file-attr-list
681      (open-paren
682       string
683       punctuation
684       "\\`[,]\\'"
685       integer-literal
686       close-paren
687       ,(semantic-lambda
688         (list
689          (cons
690           (read
691            (nth 1 vals))
692           (nth 3 vals))))
693       )
694      ) ;; end file-attr-list
695
696     (whild-attr
697      (punctuation
698       "\\`[-]\\'"
699       atom
700       semantic-list
701       "^("
702       full-stop)
703      ) ;; end whild-attr
704
705     (function-decl
706      (function-clauses
707       full-stop
708       ,(semantic-lambda
709         (nth 0 vals))
710       )
711      ) ;; end function-decl
712
713     (function-clauses
714      (function-clause
715       function-clauses-rest
716       ,(semantic-lambda
717         (nth 0 vals))
718       )
719      ) ;; end function-clauses
720
721     (function-clauses-rest
722      (punctuation
723       "\\`[;]\\'"
724       function-clauses)
725      ( ;;EMPTY
726       )
727      ) ;; end function-clauses-rest
728
729     (function-clause
730      (atom
731       fun-clause
732       ,(semantic-lambda
733         (semantic-tag-new-function
734          (concat
735           (car
736            (nth 0 vals))
737           "/"
738           (number-to-string
739            (length
740             (car
741              (nth 1 vals))))) nil
742          (nth 1 vals)))
743       )
744      ) ;; end function-clause
745
746     (record-decl
747      (punctuation
748       "\\`[-]\\'"
749       RECORD
750       semantic-list
751       "^("
752       full-stop
753       ,(semantic-lambda
754         (car
755          (semantic-parse-region
756           (car
757            (nth 2 vals))
758           (cdr
759            (nth 2 vals))
760           'record-def
761           1)))
762       )
763      ) ;; end record-decl
764
765     (record-def
766      (open-paren
767       atom
768       punctuation
769       "\\`[,]\\'"
770       semantic-list
771       "^{"
772       close-paren
773       ,(semantic-lambda
774         (semantic-tag-new-type
775          (nth 1 vals)
776          "record"
777          (semantic-parse-region
778           (car
779            (nth 3 vals))
780           (cdr
781            (nth 3 vals))
782           'record-field-decl
783           1) nil))
784       )
785      ) ;; end record-def
786
787     (record-decl-tuple
788      (open-paren
789       record-field-decls
790       close-paren
791       ,(semantic-lambda
792         (list
793          (nth 1 vals)))
794       )
795      (open-paren
796       close-paren
797       ,(semantic-lambda
798         (list nil))
799       )
800      ) ;; end record-decl-tuple
801
802     (record-field-decl
803      (atom
804       record-field-value
805       ,(semantic-lambda
806         (semantic-tag-new-variable
807          (nth 0 vals) nil
808          ""))
809       )
810      (atom
811       ,(semantic-lambda
812         (semantic-tag-new-variable
813          (nth 0 vals) nil
814          ""))
815       )
816      (open-paren
817       "{"
818       ,(semantic-lambda
819         (list nil))
820       )
821      (close-paren
822       "}"
823       ,(semantic-lambda
824         (list nil))
825       )
826      (punctuation
827       "\\`[,]\\'"
828       ,(semantic-lambda
829         (list nil))
830       )
831      ) ;; end record-field-decl
832
833     (pattern
834      (pattern-expr
835       ,(semantic-lambda
836         (nth 0 vals))
837       )
838      (uni-pattern)
839      (binary)
840      (basic-type)
841      (semantic-list
842       "^\\["
843       ,(semantic-lambda
844         (semantic-tag
845          "List"
846          'list))
847       )
848      (semantic-list
849       "^{"
850       ,(semantic-lambda
851         (semantic-tag
852          "Tuple"
853          'list))
854       )
855      (record-pattern
856       ,(semantic-lambda
857         (nth 0 vals))
858       )
859      ) ;; end pattern
860
861     (pattern-expr
862      (pattern-conc-expr
863       pattern-conc-expr-rest
864       ,(semantic-lambda
865         (nth 0 vals))
866       )
867      ) ;; end pattern-expr
868
869     (pattern-conc-expr
870      (string-literal)
871      (var)
872      ) ;; end pattern-conc-expr
873
874     (pattern-conc-expr-rest
875      (list-conc-op
876       pattern-expr
877       ,(semantic-lambda)
878       )
879      ( ;;EMPTY
880       )
881      ) ;; end pattern-conc-expr-rest
882
883     (tuple-pattern
884      (open-paren
885       patterns
886       close-paren)
887      (open-paren
888       close-paren
889       ,(semantic-lambda
890         (list nil))
891       )
892      ) ;; end tuple-pattern
893
894     (list-pattern
895      (open-paren
896       patterns
897       list-pattern-tail
898       close-paren)
899      (open-paren
900       close-paren
901       ,(semantic-lambda
902         (list nil))
903       )
904      ) ;; end list-pattern
905
906     (list-pattern-tail
907      (punctuation
908       "\\`[|]\\'"
909       pattern)
910      ( ;;EMPTY
911       ,(semantic-lambda
912         (list nil))
913       )
914      ) ;; end list-pattern-tail
915
916     (patterns
917      (pattern
918       patterns-rest
919       ,(semantic-lambda
920         (list
921          (cons
922           (car
923            (nth 0 vals))
924           (car
925            (nth 1 vals)))))
926       )
927      ) ;; end patterns
928
929     (patterns-rest
930      (punctuation
931       "\\`[,]\\'"
932       patterns
933       ,(semantic-lambda
934         (nth 1 vals))
935       )
936      ( ;;EMPTY
937       )
938      ) ;; end patterns-rest
939
940     (record-pattern
941      (punctuation
942       "\\`[#]\\'"
943       atom
944       semantic-list
945       "^{"
946       ,(semantic-lambda
947         (list
948          (car
949           (nth 1 vals))))
950       )
951      ) ;; end record-pattern
952
953     (record-pattern-tuple
954      (open-paren
955       record-field-patterns
956       close-paren
957       ,(semantic-lambda
958         (list
959          (nth 1 vals)))
960       )
961      (open-paren
962       close-paren
963       ,(semantic-lambda
964         (list nil))
965       )
966      ) ;; end record-pattern-tuple
967
968     (record-field-patterns
969      (record-field-patterns
970       punctuation
971       "\\`[,]\\'"
972       record-field-pattern)
973      (record-field-pattern)
974      ) ;; end record-field-patterns
975
976     (record-field-pattern
977      (atom
978       punctuation
979       "\\`[=]\\'"
980       pattern)
981      ) ;; end record-field-pattern
982
983     (body
984      (exprs)
985      ) ;; end body
986
987     (exprs
988      (expr
989       exprs-rest)
990      ) ;; end exprs
991
992     (exprs-rest
993      (punctuation
994       "\\`[,]\\'"
995       exprs)
996      ( ;;EMPTY
997       )
998      ) ;; end exprs-rest
999
1000     (expr
1001      (CATCH
1002       expr)
1003      (match-expr)
1004      ) ;; end expr
1005
1006     (match-expr
1007      (pattern
1008       punctuation
1009       "\\`[=]\\'"
1010       match-expr)
1011      (send-expr)
1012      ) ;; end match-expr
1013
1014     (send-expr
1015      (compare-expr
1016       send-expr-rest)
1017      ) ;; end send-expr
1018
1019     (send-expr-rest
1020      (punctuation
1021       "\\`[!]\\'"
1022       send-expr)
1023      ( ;;EMPTY
1024       )
1025      ) ;; end send-expr-rest
1026
1027     (compare-expr
1028      (list-conc-expr
1029       compare-expr-rest)
1030      ) ;; end compare-expr
1031
1032     (compare-expr-rest
1033      (comp-op
1034       list-conc-expr)
1035      ( ;;EMPTY
1036       )
1037      ) ;; end compare-expr-rest
1038
1039     (list-conc-expr
1040      (add-expr
1041       list-conc-expr-rest)
1042      ) ;; end list-conc-expr
1043
1044     (list-conc-expr-rest
1045      (list-conc-op
1046       list-conc-expr)
1047      ( ;;EMPTY
1048       )
1049      ) ;; end list-conc-expr-rest
1050
1051     (add-expr
1052      (multi-expr
1053       add-expr-rest)
1054      ) ;; end add-expr
1055
1056     (add-expr-rest
1057      (add-op
1058       add-expr)
1059      ( ;;EMPTY
1060       )
1061      ) ;; end add-expr-rest
1062
1063     (multi-expr
1064      (prefix-expr
1065       multi-expr-rest)
1066      ) ;; end multi-expr
1067
1068     (multi-expr-rest
1069      (multi-op
1070       multi-expr)
1071      ( ;;EMPTY
1072       )
1073      ) ;; end multi-expr-rest
1074
1075     (prefix-expr
1076      (prefix-op
1077       record-expr)
1078      (record-expr)
1079      ) ;; end prefix-expr
1080
1081     (record-expr
1082      (punctuation
1083       "\\`[#]\\'"
1084       record-expr-field)
1085      (application-expr
1086       record-expr-rest)
1087      ) ;; end record-expr
1088
1089     (record-expr-rest
1090      (punctuation
1091       "\\`[#]\\'"
1092       record-expr-field)
1093      ( ;;EMPTY
1094       )
1095      ) ;; end record-expr-rest
1096
1097     (record-expr-field
1098      (atom
1099       punctuation
1100       "\\`[.]\\'"
1101       atom)
1102      (atom
1103       semantic-list
1104       "^{")
1105      (record-expr)
1106      ) ;; end record-expr-field
1107
1108     (record-update-tuple
1109      (open-paren
1110       close-paren)
1111      (open-paren
1112       record-field-updates
1113       close-paren)
1114      ) ;; end record-update-tuple
1115
1116     (record-field-updates
1117      (record-field-update
1118       record-field-updates-rest)
1119      ) ;; end record-field-updates
1120
1121     (record-field-updates-rest
1122      (punctuation
1123       "\\`[,]\\'"
1124       record-field-updates)
1125      ( ;;EMPTY
1126       )
1127      ) ;; end record-field-updates-rest
1128
1129     (record-field-update
1130      (atom
1131       record-field-value)
1132      ) ;; end record-field-update
1133
1134     (record-field-value
1135      (punctuation
1136       "\\`[=]\\'"
1137       expr)
1138      ( ;;EMPTY
1139       )
1140      ) ;; end record-field-value
1141
1142     (application-expr
1143      (module-name
1144       punctuation
1145       "\\`[:]\\'"
1146       primary-expr
1147       semantic-list
1148       "^(")
1149      (primary-expr
1150       application-expr-rest)
1151      ) ;; end application-expr
1152
1153     (application-expr-rest
1154      (semantic-list
1155       "^(")
1156      (punctuation
1157       "\\`[:]\\'"
1158       primary-expr
1159       semantic-list
1160       "^(")
1161      ( ;;EMPTY
1162       )
1163      ) ;; end application-expr-rest
1164
1165     (application-expr-list
1166      (open-paren
1167       close-paren)
1168      (open-paren
1169       exprs
1170       close-paren)
1171      ) ;; end application-expr-list
1172
1173     (primary-expr
1174      (binary)
1175      (string-literal)
1176      (basic-type)
1177      (semantic-list
1178       "^{")
1179      (semantic-list
1180       "^\\[")
1181      (semantic-list
1182       "^\\[")
1183      (block-expr)
1184      (if-expr)
1185      (case-expr)
1186      (receive-expr)
1187      (fun-expr)
1188      (query-expr)
1189      (paren-expr)
1190      ) ;; end primary-expr
1191
1192     (string-literal
1193      (string)
1194      (macro-app)
1195      (string
1196       string-literal)
1197      ) ;; end string-literal
1198
1199     (tuple-skel
1200      (open-paren
1201       close-paren)
1202      (open-paren
1203       exprs
1204       close-paren)
1205      ) ;; end tuple-skel
1206
1207     (list-skel
1208      (open-paren
1209       close-paren)
1210      (open-paren
1211       exprs
1212       list-skel-tail
1213       close-paren)
1214      ) ;; end list-skel
1215
1216     (list-skel-tail
1217      (punctuation
1218       "\\`[|]\\'"
1219       expr)
1220      ( ;;EMPTY
1221       )
1222      ) ;; end list-skel-tail
1223
1224     (list-compr
1225      (open-paren
1226       expr
1227       punctuation
1228       "\\`[|]\\'"
1229       punctuation
1230       "\\`[|]\\'"
1231       list-compr-exprs
1232       close-paren)
1233      ) ;; end list-compr
1234
1235     (list-compr-exprs
1236      (list-compr-expr
1237       list-compr-exprs-rest)
1238      ) ;; end list-compr-exprs
1239
1240     (list-compr-exprs-rest
1241      (punctuation
1242       "\\`[,]\\'"
1243       list-compr-exprs)
1244      ( ;;EMPTY
1245       )
1246      ) ;; end list-compr-exprs-rest
1247
1248     (list-compr-expr
1249      (generator)
1250      (filter)
1251      ) ;; end list-compr-expr
1252
1253     (generator
1254      (pattern
1255       punctuation
1256       "\\`[<]\\'"
1257       punctuation
1258       "\\`[-]\\'"
1259       expr)
1260      ) ;; end generator
1261
1262     (filter
1263      (expr)
1264      ) ;; end filter
1265
1266     (block-expr
1267      (BEGIN
1268       body
1269       END)
1270      ) ;; end block-expr
1271
1272     (if-expr
1273      (IF
1274       if-clauses
1275       END)
1276      ) ;; end if-expr
1277
1278     (if-clauses
1279      (if-clause
1280       punctuation
1281       "\\`[;]\\'"
1282       if-clauses)
1283      (if-clause)
1284      ) ;; end if-clauses
1285
1286     (if-clause
1287      (guard
1288       clause-body)
1289      (expr
1290       clause-body)
1291      ) ;; end if-clause
1292
1293     (clause-body
1294      (punctuation
1295       "\\`[-]\\'"
1296       punctuation
1297       "\\`[>]\\'"
1298       body)
1299      ) ;; end clause-body
1300
1301     (case-expr
1302      (CASE
1303       expr
1304       OF
1305       cr-clauses
1306       END)
1307      ) ;; end case-expr
1308
1309     (cr-clauses
1310      (cr-clause
1311       punctuation
1312       "\\`[;]\\'"
1313       cr-clauses)
1314      (cr-clause)
1315      ) ;; end cr-clauses
1316
1317     (cr-clause
1318      (clause-pattern
1319       clause-guard
1320       clause-body)
1321      ) ;; end cr-clause
1322
1323     (clause-guard
1324      (WHEN
1325       guard)
1326      ( ;;EMPTY
1327       )
1328      ) ;; end clause-guard
1329
1330     (receive-expr
1331      (RECEIVE
1332       cr-clauses
1333       receive-after
1334       END)
1335      (RECEIVE
1336       receive-after
1337       END)
1338      (RECEIVE
1339       cr-clauses
1340       AFTER
1341       expr
1342       clause-body
1343       END)
1344      ) ;; end receive-expr
1345
1346     (receive-after
1347      (AFTER
1348       expr
1349       clause-body)
1350      ( ;;EMPTY
1351       )
1352      ) ;; end receive-after
1353
1354     (fun-expr
1355      (FUN
1356       function-arity)
1357      (FUN
1358       fun-clauses
1359       END)
1360      ) ;; end fun-expr
1361
1362     (fun-clauses
1363      (fun-clause
1364       fun-clauses-rest)
1365      ) ;; end fun-clauses
1366
1367     (fun-clauses-rest
1368      (punctuation
1369       "\\`[;]\\'"
1370       fun-clauses)
1371      ( ;;EMPTY
1372       )
1373      ) ;; end fun-clauses-rest
1374
1375     (fun-clause
1376      (semantic-list
1377       "^("
1378       clause-guard
1379       clause-body
1380       ,(semantic-lambda
1381         (car
1382          (semantic-bovinate-from-nonterminal
1383           (car
1384            (nth 0 vals))
1385           (cdr
1386            (nth 0 vals))
1387           'clause-pattern-list)))
1388       )
1389      ) ;; end fun-clause
1390
1391     (clause-pattern-list
1392      (open-paren
1393       clause-patterns
1394       close-paren
1395       ,(semantic-lambda
1396         (list
1397          (nth 1 vals)))
1398       )
1399      ) ;; end clause-pattern-list
1400
1401     (clause-patterns
1402      (clause-pattern
1403       clause-patterns-rest
1404       ,(semantic-lambda
1405         (list
1406          (cons
1407           (car
1408            (nth 0 vals))
1409           (car
1410            (nth 1 vals)))))
1411       )
1412      ) ;; end clause-patterns
1413
1414     (clause-patterns-rest
1415      (punctuation
1416       "\\`[,]\\'"
1417       clause-patterns
1418       ,(semantic-lambda
1419         (nth 1 vals))
1420       )
1421      ( ;;EMPTY
1422       )
1423      ) ;; end clause-patterns-rest
1424
1425     (clause-pattern
1426      (match-pattern)
1427      (pattern)
1428      ) ;; end clause-pattern
1429
1430     (match-pattern
1431      (var
1432       punctuation
1433       "\\`[=]\\'"
1434       pattern
1435       ,(semantic-lambda
1436         (nth 0 vals))
1437       )
1438      (pattern
1439       punctuation
1440       "\\`[=]\\'"
1441       var
1442       ,(semantic-lambda
1443         (nth 0 vals))
1444       )
1445      ) ;; end match-pattern
1446
1447     (query-expr
1448      (QUERY
1449       semantic-list
1450       "^\\["
1451       END)
1452      ) ;; end query-expr
1453
1454     (paren-expr
1455      (semantic-list
1456       "^(")
1457      ) ;; end paren-expr
1458
1459     (paren-expr-list
1460      (open-paren
1461       expr
1462       close-paren)
1463      ) ;; end paren-expr-list
1464
1465     (guard
1466      (guard-test
1467       guard-rest)
1468      ) ;; end guard
1469
1470     (guard-rest
1471      (punctuation
1472       "\\`[,]\\'"
1473       guard)
1474      (punctuation
1475       "\\`[;]\\'"
1476       guard)
1477      ( ;;EMPTY
1478       )
1479      ) ;; end guard-rest
1480
1481     (guard-test
1482      (TRUE)
1483      (guard-record-test)
1484      (guard-term-cmp)
1485      (guard-recognizer)
1486      (semantic-list
1487       "^(")
1488      ) ;; end guard-test
1489
1490     (guard-record-test
1491      (RECORD
1492       semantic-list
1493       "^(")
1494      (open-paren
1495       guard-expr
1496       punctuation
1497       "\\`[,]\\'"
1498       symbol
1499       close-paren)
1500      ) ;; end guard-record-test
1501
1502     (guard-recognizer
1503      (symbol
1504       semantic-list
1505       "^(")
1506      ) ;; end guard-recognizer
1507
1508     (guard-term-cmp
1509      (guard-expr
1510       guard-term-op
1511       guard-expr)
1512      ) ;; end guard-term-cmp
1513
1514     (guard-term-op
1515      (comp-op)
1516      (punctuation
1517       "\\`[=]\\'")
1518      ) ;; end guard-term-op
1519
1520     (paren-guard-test
1521      (open-paren
1522       guard-test
1523       close-paren)
1524      ) ;; end paren-guard-test
1525
1526     (guard-expr
1527      (guard-add-expr)
1528      ) ;; end guard-expr
1529
1530     (guard-add-expr
1531      (guard-multi-expr
1532       guard-add-expr-rest)
1533      ) ;; end guard-add-expr
1534
1535     (guard-add-expr-rest
1536      (add-op
1537       guard-add-expr)
1538      ( ;;EMPTY
1539       )
1540      ) ;; end guard-add-expr-rest
1541
1542     (guard-multi-expr
1543      (guard-prefix-expr
1544       guard-multi-expr-rest)
1545      ) ;; end guard-multi-expr
1546
1547     (guard-multi-expr-rest
1548      (multi-op
1549       guard-multi-expr)
1550      ( ;;EMPTY
1551       )
1552      ) ;; end guard-multi-expr-rest
1553
1554     (guard-prefix-expr
1555      (prefix-op
1556       guard-application-expr)
1557      (guard-application-expr)
1558      ) ;; end guard-prefix-expr
1559
1560     (guard-application-expr
1561      (atom
1562       semantic-list
1563       "^(")
1564      (guard-record-expr)
1565      (guard-primary-expr)
1566      ) ;; end guard-application-expr
1567
1568     (guard-exprs-list
1569      (open-paren
1570       close-paren)
1571      (open-paren
1572       guard-exprs
1573       close-paren)
1574      ) ;; end guard-exprs-list
1575
1576     (guard-exprs
1577      (guard-expr
1578       guard-exprs-rest)
1579      ) ;; end guard-exprs
1580
1581     (guard-exprs-rest
1582      (punctuation
1583       "\\`[,]\\'"
1584       guard-exprs)
1585      (punctuation
1586       "\\`[;]\\'"
1587       guard-exprs)
1588      ( ;;EMPTY
1589       )
1590      ) ;; end guard-exprs-rest
1591
1592     (guard-record-expr
1593      (punctuation
1594       "\\`[#]\\'"
1595       atom
1596       punctuation
1597       "\\`[.]\\'"
1598       atom)
1599      (guard-primary-expr
1600       punctuation
1601       "\\`[#]\\'"
1602       atom
1603       punctuation
1604       "\\`[.]\\'"
1605       atom)
1606      ) ;; end guard-record-expr
1607
1608     (guard-primary-expr
1609      (basic-type)
1610      (macro-app)
1611      (semantic-list
1612       "^{")
1613      (semantic-list
1614       "^\\[")
1615      (semantic-list
1616       "^(")
1617      ) ;; end guard-primary-expr
1618
1619     (guard-tuple-skel
1620      (open-paren
1621       close-paren)
1622      (open-paren
1623       guard-exprs
1624       close-paren)
1625      ) ;; end guard-tuple-skel
1626
1627     (guard-list-skel
1628      (open-paren
1629       close-paren)
1630      (open-paren
1631       guard-exprs
1632       guard-list-skel-tail
1633       close-paren)
1634      ) ;; end guard-list-skel
1635
1636     (guard-list-skel-tail
1637      (punctuation
1638       "\\`[|]\\'"
1639       guard-expr)
1640      ( ;;EMPTY
1641       )
1642      ) ;; end guard-list-skel-tail
1643
1644     (guard-paren-expr
1645      (open-paren
1646       guard-expr
1647       close-paren)
1648      ) ;; end guard-paren-expr
1649
1650     (directive
1651      (macro-def)
1652      (macro-undef)
1653      (include-dir)
1654      (include-lib-dir)
1655      (ifdef-dir)
1656      (ifndef-dir)
1657      (else-dir)
1658      (endif-dir)
1659      ) ;; end directive
1660
1661     (macro-def
1662      (punctuation
1663       "\\`[-]\\'"
1664       DEFINE
1665       semantic-list
1666       "^("
1667       full-stop
1668       ,(semantic-lambda
1669         (semantic-bovinate-from-nonterminal
1670          (car
1671           (nth 2 vals))
1672          (cdr
1673           (nth 2 vals))
1674          'macro-def-list))
1675       )
1676      ) ;; end macro-def
1677
1678     (macro-def-list
1679      (open-paren
1680       symbol
1681       macro-def-opt
1682       punctuation
1683       "\\`[,]\\'"
1684       macro-def-opt
1685       close-paren
1686       ,(semantic-lambda
1687         (semantic-tag-new-variable
1688          (nth 1 vals) nil
1689          (nth 4 vals) :constant-flag t))
1690       )
1691      ) ;; end macro-def-list
1692
1693     (macro-def-opt
1694      (semantic-list)
1695      (expr)
1696      ( ;;EMPTY
1697       )
1698      ) ;; end macro-def-opt
1699
1700     (macro-undef
1701      (punctuation
1702       "\\`[-]\\'"
1703       UNDEF
1704       semantic-list
1705       "^("
1706       full-stop)
1707      ) ;; end macro-undef
1708
1709     (macro-app
1710      (punctuation
1711       "\\`[?]\\'"
1712       symbol
1713       semantic-list
1714       "^(")
1715      (punctuation
1716       "\\`[?]\\'"
1717       symbol)
1718      ) ;; end macro-app
1719
1720     (include-dir
1721      (punctuation
1722       "\\`[-]\\'"
1723       INCLUDE
1724       semantic-list
1725       "^("
1726       full-stop
1727       ,(semantic-lambda
1728         (semantic-tag-new-include
1729          (car
1730           (semantic-bovinate-from-nonterminal
1731            (car
1732             (nth 2 vals))
1733            (cdr
1734             (nth 2 vals))
1735            'include-file-name)) nil))
1736       )
1737      ) ;; end include-dir
1738
1739     (include-lib-dir
1740      (punctuation
1741       "\\`[-]\\'"
1742       INCLUDE_LIB
1743       semantic-list
1744       "^("
1745       full-stop
1746       ,(semantic-lambda
1747         (semantic-tag-new-include
1748          (car
1749           (semantic-bovinate-from-nonterminal
1750            (car
1751             (nth 2 vals))
1752            (cdr
1753             (nth 2 vals))
1754            'include-file-name)) nil))
1755       )
1756      ) ;; end include-lib-dir
1757
1758     (include-file-name
1759      (open-paren
1760       string
1761       close-paren
1762       ,(semantic-lambda
1763         (list
1764          (read
1765           (nth 1 vals))))
1766       )
1767      ) ;; end include-file-name
1768
1769     (ifdef-dir
1770      (punctuation
1771       "\\`[-]\\'"
1772       IFDEF
1773       semantic-list
1774       "^("
1775       full-stop)
1776      ) ;; end ifdef-dir
1777
1778     (ifndef-dir
1779      (punctuation
1780       "\\`[-]\\'"
1781       IFNDEF
1782       semantic-list
1783       "^("
1784       full-stop)
1785      ) ;; end ifndef-dir
1786
1787     (else-dir
1788      (punctuation
1789       "\\`[-]\\'"
1790       ELSE
1791       full-stop)
1792      ) ;; end else-dir
1793
1794     (endif-dir
1795      (punctuation
1796       "\\`[-]\\'"
1797       ENDIF
1798       full-stop)
1799      ) ;; end endif-dir
1800
1801     (full-stop
1802      (punctuation
1803       "\\`[.]\\'")
1804      ) ;; end full-stop
1805     )
1806   "Parser table.")
1807
1808 (defun semantic-erlang-by--install-parser ()
1809   "Setup the Semantic Parser."
1810   (setq semantic--parse-table semantic-erlang-by--parse-table
1811         semantic-debug-parser-source "erlang.by"
1812         semantic-debug-parser-class 'semantic-bovine-debug-parser
1813         semantic-flex-keywords-obarray semantic-erlang-by--keyword-table
1814         ))
1815
1816 \f
1817 ;;; Analyzers
1818 ;;
1819 (require 'semantic-lex)
1820
1821 \f
1822 ;;; Epilogue
1823 ;;
1824
1825 (provide 'semantic-erlang-by)
1826
1827 ;;; semantic-erlang-by.el ends here