1 ;;; wisent-calc-wy.el --- Generated parser support file
3 ;; Copyright (C) 2002, 2003 David Ponce
5 ;; Author: Eric M. Ludlam <zappo@projectile.siege-engine.com>
6 ;; Created: 2007-06-05 21:46:55-0400
8 ;; X-RCS: $Id: wisent-calc-wy.el,v 1.1 2007-11-26 15:12:28 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-calc.wy.
42 (defconst wisent-calc-wy--keyword-table
43 (semantic-lex-make-keyword-table 'nil 'nil)
44 "Table of language keywords.")
46 (defconst wisent-calc-wy--token-table
47 (semantic-lex-make-type-table
51 "Table of lexical tokens.")
53 (defconst wisent-calc-wy--parse-table
56 (require 'wisent-comp))
57 (wisent-compile-grammar
67 (format "%s %s" $1 $2)))
77 (string-to-number $1))
98 (defun wisent-calc-wy--install-parser ()
99 "Setup the Semantic Parser."
100 (semantic-install-function-overrides
101 '((parse-stream . wisent-parse-stream)))
102 (setq semantic-parser-name "LALR"
103 semantic--parse-table wisent-calc-wy--parse-table
104 semantic-debug-parser-source "wisent-calc.wy"
105 semantic-flex-keywords-obarray wisent-calc-wy--keyword-table
106 semantic-lex-types-obarray wisent-calc-wy--token-table)
107 ;; Collect unmatched syntax lexical tokens
108 (semantic-make-local-hook 'wisent-discarding-token-functions)
109 (add-hook 'wisent-discarding-token-functions
110 'wisent-collect-unmatched-syntax nil t))
115 (require 'semantic-lex)
120 (defun wisent-calc-setup-parser ()
121 "Setup buffer for parse."
122 (wisent-calc-wy--install-parser)
123 (setq semantic-number-expression
124 (concat "\\([0-9]+\\([.][0-9]*\\)?\\([eE][-+]?[0-9]+\\)?"
125 "\\|[.][0-9]+\\([eE][-+]?[0-9]+\\)?\\)")
126 semantic-lex-analyzer 'wisent-calc-lexer
127 semantic-lex-depth nil
128 semantic-lex-syntax-modifications
129 '((?\; ".") (?\= ".") (?\+ ".")
130 (?\- ".") (?\* ".") (?\/ ".")
131 (?\^ ".") (?\( ".") (?\) ".")
136 (provide 'wisent-calc-wy)
138 ;;; wisent-calc-wy.el ends here