1 ;;; wisent-awk-wy.el --- Generated parser support file
3 ;; Copyright (C) 2002 David Ponce
5 ;; Author: Eric M. Ludlam <zappo@projectile.siege-engine.com>
6 ;; Created: 2007-06-05 21:46:54-0400
8 ;; X-RCS: $Id: wisent-awk-wy.el,v 1.1 2007-11-26 15:12:27 michaels Exp $
10 ;; This file is not part of GNU Emacs.
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.
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.
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.
29 ;; PLEASE DO NOT MANUALLY EDIT THIS FILE! It is automatically
30 ;; generated from the grammar file wisent-awk.wy.
42 (defconst wisent-awk-wy--keyword-table
43 (semantic-lex-make-keyword-table 'nil 'nil)
44 "Table of language keywords.")
46 (defconst wisent-awk-wy--token-table
47 (semantic-lex-make-type-table
87 "Table of lexical tokens.")
89 (defconst wisent-awk-wy--parse-table
92 (require 'wisent-comp))
93 (wisent-compile-grammar
94 '((FUNC_CALL NAME REGEXP ERROR YNUMBER YSTRING RELOP APPEND_OP ASSIGNOP MATCHOP NEWLINE CONCAT_OP LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION LEX_GETLINE LEX_NEXTFILE LEX_IN LEX_AND LEX_OR INCREMENT DECREMENT LEX_BUILTIN LEX_LENGTH)
101 (left FUNC_CALL LEX_BUILTIN LEX_LENGTH)
104 (nonassoc RELOP 60 62 124 APPEND_OP TWOWAYIO)
106 (left YSTRING YNUMBER)
111 (left INCREMENT DECREMENT)
115 ((opt_nls program opt_nls)))
129 ((LEX_BEGIN statement_term))
130 ((LEX_END statement_term))
133 ((pattern statement_term))
134 ((function_prologue function_body)))
145 func_name 40 opt_param_list r_paren opt_nls)))
147 ((l_brace statements r_brace opt_semi opt_nls))
148 ((l_brace r_brace opt_semi opt_nls)))
157 ((l_brace statements r_brace opt_semi opt_nls))
158 ((l_brace r_brace opt_semi opt_nls)))
161 ((statements statement))
163 ((statements error)))
170 ((l_brace statements r_brace))
172 ((LEX_WHILE 40 exp r_paren opt_nls statement))
173 ((LEX_DO opt_nls statement LEX_WHILE 40 exp r_paren opt_nls))
174 ((LEX_FOR 40 NAME LEX_IN NAME r_paren opt_nls statement))
175 ((LEX_FOR 40 opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement))
176 ((LEX_FOR 40 opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement))
177 ((LEX_BREAK statement_term))
178 ((LEX_CONTINUE statement_term))
179 ((print 40 expression_list r_paren output_redir statement_term))
180 ((print opt_rexpression_list output_redir statement_term))
181 ((LEX_NEXT statement_term))
182 ((LEX_NEXTFILE statement_term))
183 ((LEX_EXIT opt_exp statement_term))
186 opt_exp statement_term))
187 ((LEX_DELETE NAME 91 expression_list 93 statement_term))
188 ((LEX_DELETE NAME statement_term))
189 ((exp statement_term)))
194 ((LEX_IF 40 exp r_paren opt_nls statement))
195 ((LEX_IF 40 exp r_paren opt_nls statement LEX_ELSE opt_nls statement)))
216 ((param_list comma NAME))
219 ((param_list comma error)))
223 (opt_rexpression_list
225 ((rexpression_list)))
228 ((rexpression_list comma rexp))
230 ((rexpression_list error))
231 ((rexpression_list error rexp))
232 ((rexpression_list comma error)))
238 ((expression_list comma exp))
240 ((expression_list error))
241 ((expression_list error exp))
242 ((expression_list comma error)))
247 ((40 expression_list r_paren LEX_IN NAME))
248 ((exp 124 LEX_GETLINE opt_variable))
249 ((exp TWOWAYIO LEX_GETLINE opt_variable))
250 ((LEX_GETLINE opt_variable input_redir))
261 ((exp 63 exp 58 exp))
269 ((rexp LEX_AND rexp))
271 ((LEX_GETLINE opt_variable input_redir))
275 ((rexp MATCHOP rexp))
278 ((rexp 63 rexp 58 rexp))
283 ((non_post_simp_exp))
284 ((simp_exp 94 simp_exp))
285 ((simp_exp 42 simp_exp))
286 ((simp_exp 47 simp_exp))
287 ((simp_exp 37 simp_exp))
288 ((simp_exp 43 simp_exp))
289 ((simp_exp 45 simp_exp))
290 ((variable INCREMENT))
291 ((variable DECREMENT)))
296 ((LEX_BUILTIN 40 opt_expression_list r_paren))
297 ((LEX_LENGTH 40 opt_expression_list r_paren))
299 ((FUNC_CALL 40 opt_expression_list r_paren))
301 ((INCREMENT variable))
302 ((DECREMENT variable))
314 ((NAME 91 expression_list 93))
315 ((36 non_post_simp_exp)))
332 (defun wisent-awk-wy--install-parser ()
333 "Setup the Semantic Parser."
334 (semantic-install-function-overrides
335 '((parse-stream . wisent-parse-stream)))
336 (setq semantic-parser-name "LALR"
337 semantic--parse-table wisent-awk-wy--parse-table
338 semantic-debug-parser-source "wisent-awk.wy"
339 semantic-flex-keywords-obarray wisent-awk-wy--keyword-table
340 semantic-lex-types-obarray wisent-awk-wy--token-table)
341 ;; Collect unmatched syntax lexical tokens
342 (semantic-make-local-hook 'wisent-discarding-token-functions)
343 (add-hook 'wisent-discarding-token-functions
344 'wisent-collect-unmatched-syntax nil t))
349 (require 'semantic-lex)
358 (provide 'wisent-awk-wy)
360 ;;; wisent-awk-wy.el ends here