From 237c124de57b05c882dae71752ad792340b4add1 Mon Sep 17 00:00:00 2001 From: Robert Virding Date: Sat, 17 Jul 2010 22:23:21 +0200 Subject: [PATCH 1/4] Add new example file with core LFE macros. This example file contains many of the core LFE macros written in LFE. They are all include in lfe_macro.erl but here we show how they could have been written in LFE. --- examples/core-macros.lfe | 130 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 examples/core-macros.lfe diff --git a/examples/core-macros.lfe b/examples/core-macros.lfe new file mode 100644 index 00000000..c38370f3 --- /dev/null +++ b/examples/core-macros.lfe @@ -0,0 +1,130 @@ +;; Copyright (c) 2008-2010 Robert Virding. All rights reserved. + +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions +;; are met: + +;; 1. Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; 2. Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. + +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +;; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +;; COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +;; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +;; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +;; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +;; ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +;; POSSIBILITY OF SUCH DAMAGE. + +;; File : core-macros.lfe +;; Author : Robert Virding +;; Purpose : Some of LFE core macrosas they could have been implemented in LFE. + +;; This file contains some of the core LFE macros as they could have +;; been implemented in LFE. They are implemented in lfe_macro.erl +;; today as there is yet no way to compile macros, and to ensure that +;; they are always available. These are shown mostly without comments. + +(defmacro caar (x) `(car (car ,x))) +(defmacro cadr (x) `(car (cdr ,x))) +(defmacro cdar (x) `(cdr (car ,x))) +(defmacro cddr (x) `(cdr (cdr ,x))) + +(defmacro ++ + ((e) e) + ((e . es) `(call 'erlang '++ ,e (++ . ,es))) + (() ())) + +(defmacro : + ((m f . as) `(call ',m ',f . ,as))) + +(defmacro ? () `(receive (omega omega))) + +(defmacro list* + ((e) e) + ((e . es) `(cons ,e (list* . ,es))) + (() ())) + +(defmacro let* + (((vb . vbs) . b) `(let (,vb) (let* ,vbs . ,b))) + ((() . b) `(progn . ,b)) + ((vb . b) `(let ,vb . b))) ;Pass error to let + +(defmacro flet* + (((vb . vbs) . b) `(flet (,vb) (flet* ,vbs . ,b))) + ((() . b) `(progn . ,b)) + ((vb . b) `(flet ,vb . b))) ;Pass error to flet + +(defmacro cond + ((('else . b)) `(progn . ,b)) + (((('?= p e) . b) . cond) + `(case ,e (,p . ,b) (_ (cond . ,cond)))) + (((('?= p (= ('when . _) g) e) . b) . cond) + `(case ,e (,p ,g . ,b) (_ (cond . ,cond)))) + (((test . b) . cond) `(if ,test (progn . ,b) (cond . ,cond))) + (() `'false)) + +(defmacro andalso + ((e) e) + ((e . es) `(if ,e (andalso . ,es) 'false)) + (() `'true)) + +(defmacro orelse + ((e) e) + ((e . es) `(if ,e 'true (orelse . ,es))) + (() `'false)) + +;; This version of backquote is almost an exact copy of a quasiquote +;; expander for Scheme by André van Tonder. It is very compact and +;; with some cons/append optimisations we have added produces quite +;; reasonable code. + +(defmacro backquote (e) (bq-expand e 0)) + +(eval-when-compile + (defun bq-expand (exp n) + ;; Note that we cannot *use* backquote or any macros using + ;; backquote in here! It will cause us to loop. + (fletrec ((bq-app ;Optimise append + ([('++ l) r] (bq-app l r)) ;Catch single unquote-splice + ([() r] r) + ([l ()] l) + ([('list l) ('list . r)] (cons 'list (cons l r))) + ([('list l) r] (list 'cons l r)) + ([l r] (list '++ l r))) + (bq-cons ;Optimise cons + ([('quote l) ('quote r)] (list 'quote (cons l r))) + ([l ('list . r)] (cons 'list (cons l r))) + ([l ()] (list 'list l)) + ([l r] (list 'cons l r)))) + (case exp + (('backquote x) ;`(list 'backquote ,(bq-expand x (+ n 1))) + (list 'list (list 'quote 'backquote) (bq-expand x (+ n 1)))) + (('unquote x) (when (> n 0)) + (bq-cons 'unquote (bq-expand x (- n 1)))) + (('unquote x) (when (=:= n 0)) x) + (('unquote-splicing . x) (when (> n 0)) + (bq-cons (list 'quote 'unquote-splicing) (bq-expand x (- n 1)))) + ;; The next two cases handle splicing into a list. + ((('unquote . x) . y) (when (=:= n 0)) + (bq-app (cons 'list x) (bq-expand y 0))) + ((('unquote-splicing . x) . y) (when (=:= n 0)) + (bq-app (cons '++ x) (bq-expand y 0))) + ((x . y) ;The general list case + (bq-cons (bq-expand x n) (bq-expand y n))) + (_ (when (is_tuple exp)) + ;; Tuples need some smartness for efficient code to handle + ;; when no splicing so as to avoid list_to_tuple. + (case (bq-expand (tuple_to_list exp) n) + (('list . es) (cons tuple es)) + ((= ('cons . _) e) (list 'list_to_tuple e)))) + (_ (when (is_atom exp)) (list 'quote exp)) + (_ exp)) ;Self quoting + ))) From 75d13432ed9e89e23aecf76a8d8616bcb808a811 Mon Sep 17 00:00:00 2001 From: Robert Virding Date: Sat, 17 Jul 2010 22:33:39 +0200 Subject: [PATCH 2/4] Add explicit patterns for matching integers and floats. --- src/lfe_scan.erl | 1132 +++++++++++++++++++++++++++------------------- src/lfe_scan.xrl | 18 +- 2 files changed, 677 insertions(+), 473 deletions(-) diff --git a/src/lfe_scan.erl b/src/lfe_scan.erl index 3140351b..e483fcde 100644 --- a/src/lfe_scan.erl +++ b/src/lfe_scan.erl @@ -1,4 +1,4 @@ --file("/usr/local/lib/erlang/lib/parsetools-2.0.1/include/leexinc.hrl", 0). +-file("/usr/local/lib/erlang/lib/parsetools-2.0.3/include/leexinc.hrl", 0). %% The source of this file is part of leex distribution, as such it %% has the same Copyright as the other files in the leex %% distribution. The Copyright is defined in the accompanying file @@ -12,7 +12,7 @@ -export([format_error/1]). %% User code. This is placed here to allow extra attributes. --file("src/lfe_scan.xrl", 92). +-file("src/lfe_scan.xrl", 98). %% Copyright (c) 2008-2010 Robert Virding. All rights reserved. %% %% Redistribution and use in source and binary forms, with or without @@ -110,7 +110,7 @@ escape_char($s) -> $\s; %\s = SPC escape_char($d) -> $\d; %\d = DEL escape_char(C) -> C. --file("/usr/local/lib/erlang/lib/parsetools-2.0.1/include/leexinc.hrl", 14). +-file("/usr/local/lib/erlang/lib/parsetools-2.0.3/include/leexinc.hrl", 14). format_error({illegal,S}) -> ["illegal characters ",io_lib:write_string(S)]; format_error({user,S}) -> S. @@ -371,506 +371,686 @@ yysuf(List, N) -> lists:nthtail(N, List). %% input. -file("src/lfe_scan.erl", 372). -yystate() -> 40. +yystate() -> 47. -yystate(43, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 55 -> +yystate(50, Ics, Line, Tlen, _, _) -> + {13,Tlen,Ics,Line}; +yystate(49, [59|Ics], Line, Tlen, _, _) -> + yystate(15, Ics, Line, Tlen+1, 24, Tlen); +yystate(49, [10|Ics], Line, Tlen, _, _) -> + yystate(49, Ics, Line+1, Tlen+1, 24, Tlen); +yystate(49, [C|Ics], Line, Tlen, _, _) when C >= 0, C =< 9 -> + yystate(49, Ics, Line, Tlen+1, 24, Tlen); +yystate(49, [C|Ics], Line, Tlen, _, _) when C >= 11, C =< 32 -> + yystate(49, Ics, Line, Tlen+1, 24, Tlen); +yystate(49, Ics, Line, Tlen, _, _) -> + {24,Tlen,Ics,Line,49}; +yystate(48, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(48, Ics, Line, Tlen+1, 13, Tlen); +yystate(48, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 70 -> + yystate(48, Ics, Line, Tlen+1, 13, Tlen); +yystate(48, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 102 -> + yystate(48, Ics, Line, Tlen+1, 13, Tlen); +yystate(48, Ics, Line, Tlen, _, _) -> + {13,Tlen,Ics,Line,48}; +yystate(47, [125|Ics], Line, Tlen, Action, Alen) -> + yystate(28, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [124|Ics], Line, Tlen, Action, Alen) -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [123|Ics], Line, Tlen, Action, Alen) -> + yystate(28, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [96|Ics], Line, Tlen, Action, Alen) -> + yystate(19, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [94|Ics], Line, Tlen, Action, Alen) -> + yystate(45, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [95|Ics], Line, Tlen, Action, Alen) -> + yystate(45, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [93|Ics], Line, Tlen, Action, Alen) -> + yystate(28, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [92|Ics], Line, Tlen, Action, Alen) -> + yystate(45, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [91|Ics], Line, Tlen, Action, Alen) -> + yystate(28, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [59|Ics], Line, Tlen, Action, Alen) -> + yystate(15, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [58|Ics], Line, Tlen, Action, Alen) -> + yystate(45, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [47|Ics], Line, Tlen, Action, Alen) -> + yystate(45, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [46|Ics], Line, Tlen, Action, Alen) -> + yystate(12, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [45|Ics], Line, Tlen, Action, Alen) -> + yystate(24, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [44|Ics], Line, Tlen, Action, Alen) -> + yystate(16, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [43|Ics], Line, Tlen, Action, Alen) -> + yystate(24, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [42|Ics], Line, Tlen, Action, Alen) -> + yystate(45, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [40|Ics], Line, Tlen, Action, Alen) -> + yystate(28, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [41|Ics], Line, Tlen, Action, Alen) -> + yystate(28, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [39|Ics], Line, Tlen, Action, Alen) -> + yystate(32, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [35|Ics], Line, Tlen, Action, Alen) -> + yystate(36, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [34|Ics], Line, Tlen, Action, Alen) -> yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [33|Ics], Line, Tlen, Action, Alen) -> + yystate(45, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [10|Ics], Line, Tlen, Action, Alen) -> + yystate(49, Ics, Line+1, Tlen+1, Action, Alen); +yystate(47, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> + yystate(49, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 32 -> + yystate(49, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [C|Ics], Line, Tlen, Action, Alen) when C >= 36, C =< 38 -> + yystate(45, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> + yystate(11, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [C|Ics], Line, Tlen, Action, Alen) when C >= 60, C =< 90 -> + yystate(45, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 122 -> + yystate(45, Ics, Line, Tlen+1, Action, Alen); +yystate(47, [C|Ics], Line, Tlen, Action, Alen) when C >= 126 -> + yystate(45, Ics, Line, Tlen+1, Action, Alen); +yystate(47, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,47}; +yystate(46, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> + yystate(42, Ics, Line, Tlen+1, Action, Alen); +yystate(46, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 70 -> + yystate(42, Ics, Line, Tlen+1, Action, Alen); +yystate(46, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 102 -> + yystate(42, Ics, Line, Tlen+1, Action, Alen); +yystate(46, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,46}; +yystate(45, [124|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(45, [92|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(45, [33|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(45, [C|Ics], Line, Tlen, _, _) when C >= 35, C =< 39 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(45, [C|Ics], Line, Tlen, _, _) when C >= 42, C =< 58 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(45, [C|Ics], Line, Tlen, _, _) when C >= 60, C =< 90 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(45, [C|Ics], Line, Tlen, _, _) when C >= 94, C =< 122 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(45, [C|Ics], Line, Tlen, _, _) when C >= 126 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(45, Ics, Line, Tlen, _, _) -> + {23,Tlen,Ics,Line,45}; +yystate(44, [120|Ics], Line, Tlen, Action, Alen) -> + yystate(48, Ics, Line, Tlen+1, Action, Alen); +yystate(44, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> + yystate(50, Ics, Line, Tlen+1, Action, Alen); +yystate(44, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 119 -> + yystate(50, Ics, Line, Tlen+1, Action, Alen); +yystate(44, [C|Ics], Line, Tlen, Action, Alen) when C >= 121 -> + yystate(50, Ics, Line, Tlen+1, Action, Alen); +yystate(44, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,44}; +yystate(43, [124|Ics], Line, Tlen, Action, Alen) -> + yystate(39, Ics, Line, Tlen+1, Action, Alen); +yystate(43, [92|Ics], Line, Tlen, Action, Alen) -> + yystate(35, Ics, Line, Tlen+1, Action, Alen); +yystate(43, [10|Ics], Line, Tlen, Action, Alen) -> + yystate(43, Ics, Line+1, Tlen+1, Action, Alen); +yystate(43, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(43, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 91 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(43, [C|Ics], Line, Tlen, Action, Alen) when C >= 93, C =< 123 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(43, [C|Ics], Line, Tlen, Action, Alen) when C >= 125 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); yystate(43, Ics, Line, Tlen, Action, Alen) -> {Action,Alen,Tlen,Ics,Line,43}; -yystate(42, [59|Ics], Line, Tlen, _, _) -> - yystate(8, Ics, Line, Tlen+1, 22, Tlen); -yystate(42, [10|Ics], Line, Tlen, _, _) -> - yystate(42, Ics, Line+1, Tlen+1, 22, Tlen); -yystate(42, [C|Ics], Line, Tlen, _, _) when C >= 0, C =< 9 -> - yystate(42, Ics, Line, Tlen+1, 22, Tlen); -yystate(42, [C|Ics], Line, Tlen, _, _) when C >= 11, C =< 32 -> - yystate(42, Ics, Line, Tlen+1, 22, Tlen); +yystate(42, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(42, Ics, Line, Tlen+1, 19, Tlen); +yystate(42, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 70 -> + yystate(42, Ics, Line, Tlen+1, 19, Tlen); +yystate(42, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 102 -> + yystate(42, Ics, Line, Tlen+1, 19, Tlen); yystate(42, Ics, Line, Tlen, _, _) -> - {22,Tlen,Ics,Line,42}; -yystate(41, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 55 -> - yystate(41, Ics, Line, Tlen+1, 17, Tlen); -yystate(41, Ics, Line, Tlen, _, _) -> - {17,Tlen,Ics,Line,41}; -yystate(40, [125|Ics], Line, Tlen, Action, Alen) -> - yystate(7, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [124|Ics], Line, Tlen, Action, Alen) -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [123|Ics], Line, Tlen, Action, Alen) -> - yystate(7, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [96|Ics], Line, Tlen, Action, Alen) -> - yystate(12, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [94|Ics], Line, Tlen, Action, Alen) -> - yystate(38, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [95|Ics], Line, Tlen, Action, Alen) -> - yystate(38, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [93|Ics], Line, Tlen, Action, Alen) -> - yystate(7, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [92|Ics], Line, Tlen, Action, Alen) -> - yystate(38, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [91|Ics], Line, Tlen, Action, Alen) -> - yystate(7, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [59|Ics], Line, Tlen, Action, Alen) -> - yystate(8, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [46|Ics], Line, Tlen, Action, Alen) -> - yystate(4, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [45|Ics], Line, Tlen, Action, Alen) -> - yystate(38, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [44|Ics], Line, Tlen, Action, Alen) -> - yystate(0, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [42|Ics], Line, Tlen, Action, Alen) -> - yystate(38, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [43|Ics], Line, Tlen, Action, Alen) -> - yystate(38, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [40|Ics], Line, Tlen, Action, Alen) -> - yystate(7, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [41|Ics], Line, Tlen, Action, Alen) -> - yystate(7, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [39|Ics], Line, Tlen, Action, Alen) -> - yystate(11, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [35|Ics], Line, Tlen, Action, Alen) -> - yystate(15, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [34|Ics], Line, Tlen, Action, Alen) -> + {19,Tlen,Ics,Line,42}; +yystate(41, [92|Ics], Line, Tlen, Action, Alen) -> + yystate(29, Ics, Line, Tlen+1, Action, Alen); +yystate(41, [34|Ics], Line, Tlen, Action, Alen) -> + yystate(37, Ics, Line, Tlen+1, Action, Alen); +yystate(41, [10|Ics], Line, Tlen, Action, Alen) -> + yystate(41, Ics, Line+1, Tlen+1, Action, Alen); +yystate(41, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(41, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 33 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(41, [C|Ics], Line, Tlen, Action, Alen) when C >= 35, C =< 91 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(41, [C|Ics], Line, Tlen, Action, Alen) when C >= 93 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(41, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,41}; +yystate(40, Ics, Line, Tlen, _, _) -> + {3,Tlen,Ics,Line}; +yystate(39, Ics, Line, Tlen, _, _) -> + {15,Tlen,Ics,Line}; +yystate(38, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 55 -> yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [33|Ics], Line, Tlen, Action, Alen) -> - yystate(38, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [10|Ics], Line, Tlen, Action, Alen) -> - yystate(42, Ics, Line+1, Tlen+1, Action, Alen); -yystate(40, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> - yystate(42, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 32 -> - yystate(42, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [C|Ics], Line, Tlen, Action, Alen) when C >= 36, C =< 38 -> - yystate(38, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [C|Ics], Line, Tlen, Action, Alen) when C >= 47, C =< 58 -> - yystate(38, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [C|Ics], Line, Tlen, Action, Alen) when C >= 60, C =< 90 -> - yystate(38, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 122 -> - yystate(38, Ics, Line, Tlen+1, Action, Alen); -yystate(40, [C|Ics], Line, Tlen, Action, Alen) when C >= 126 -> +yystate(38, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,38}; +yystate(37, Ics, Line, Tlen, _, _) -> + {14,Tlen,Ics,Line}; +yystate(36, [120|Ics], Line, Tlen, Action, Alen) -> + yystate(46, Ics, Line, Tlen+1, Action, Alen); +yystate(36, [111|Ics], Line, Tlen, Action, Alen) -> yystate(38, Ics, Line, Tlen+1, Action, Alen); -yystate(40, Ics, Line, Tlen, Action, Alen) -> - {Action,Alen,Tlen,Ics,Line,40}; -yystate(39, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> - yystate(39, Ics, Line, Tlen+1, 19, Tlen); -yystate(39, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 70 -> - yystate(39, Ics, Line, Tlen+1, 19, Tlen); -yystate(39, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 102 -> - yystate(39, Ics, Line, Tlen+1, 19, Tlen); -yystate(39, Ics, Line, Tlen, _, _) -> - {19,Tlen,Ics,Line,39}; -yystate(38, [124|Ics], Line, Tlen, _, _) -> - yystate(38, Ics, Line, Tlen+1, 21, Tlen); -yystate(38, [92|Ics], Line, Tlen, _, _) -> - yystate(38, Ics, Line, Tlen+1, 21, Tlen); -yystate(38, [33|Ics], Line, Tlen, _, _) -> - yystate(38, Ics, Line, Tlen+1, 21, Tlen); -yystate(38, [C|Ics], Line, Tlen, _, _) when C >= 35, C =< 39 -> - yystate(38, Ics, Line, Tlen+1, 21, Tlen); -yystate(38, [C|Ics], Line, Tlen, _, _) when C >= 42, C =< 58 -> - yystate(38, Ics, Line, Tlen+1, 21, Tlen); -yystate(38, [C|Ics], Line, Tlen, _, _) when C >= 60, C =< 90 -> - yystate(38, Ics, Line, Tlen+1, 21, Tlen); -yystate(38, [C|Ics], Line, Tlen, _, _) when C >= 94, C =< 122 -> - yystate(38, Ics, Line, Tlen+1, 21, Tlen); -yystate(38, [C|Ics], Line, Tlen, _, _) when C >= 126 -> - yystate(38, Ics, Line, Tlen+1, 21, Tlen); -yystate(38, Ics, Line, Tlen, _, _) -> - {21,Tlen,Ics,Line,38}; -yystate(37, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> - yystate(33, Ics, Line, Tlen+1, Action, Alen); -yystate(37, Ics, Line, Tlen, Action, Alen) -> - {Action,Alen,Tlen,Ics,Line,37}; -yystate(36, [124|Ics], Line, Tlen, Action, Alen) -> - yystate(32, Ics, Line, Tlen+1, Action, Alen); +yystate(36, [100|Ics], Line, Tlen, Action, Alen) -> + yystate(30, Ics, Line, Tlen+1, Action, Alen); +yystate(36, [98|Ics], Line, Tlen, Action, Alen) -> + yystate(22, Ics, Line, Tlen+1, Action, Alen); +yystate(36, [96|Ics], Line, Tlen, Action, Alen) -> + yystate(40, Ics, Line, Tlen+1, Action, Alen); yystate(36, [92|Ics], Line, Tlen, Action, Alen) -> - yystate(28, Ics, Line, Tlen+1, Action, Alen); -yystate(36, [10|Ics], Line, Tlen, Action, Alen) -> - yystate(36, Ics, Line+1, Tlen+1, Action, Alen); -yystate(36, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(36, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 91 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(36, [C|Ics], Line, Tlen, Action, Alen) when C >= 93, C =< 123 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(36, [C|Ics], Line, Tlen, Action, Alen) when C >= 125 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); + yystate(44, Ics, Line, Tlen+1, Action, Alen); +yystate(36, [88|Ics], Line, Tlen, Action, Alen) -> + yystate(46, Ics, Line, Tlen+1, Action, Alen); +yystate(36, [79|Ics], Line, Tlen, Action, Alen) -> + yystate(38, Ics, Line, Tlen+1, Action, Alen); +yystate(36, [68|Ics], Line, Tlen, Action, Alen) -> + yystate(30, Ics, Line, Tlen+1, Action, Alen); +yystate(36, [66|Ics], Line, Tlen, Action, Alen) -> + yystate(22, Ics, Line, Tlen+1, Action, Alen); +yystate(36, [59|Ics], Line, Tlen, Action, Alen) -> + yystate(10, Ics, Line, Tlen+1, Action, Alen); +yystate(36, [44|Ics], Line, Tlen, Action, Alen) -> + yystate(5, Ics, Line, Tlen+1, Action, Alen); +yystate(36, [40|Ics], Line, Tlen, Action, Alen) -> + yystate(13, Ics, Line, Tlen+1, Action, Alen); +yystate(36, [39|Ics], Line, Tlen, Action, Alen) -> + yystate(17, Ics, Line, Tlen+1, Action, Alen); +yystate(36, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> + yystate(6, Ics, Line, Tlen+1, Action, Alen); yystate(36, Ics, Line, Tlen, Action, Alen) -> {Action,Alen,Tlen,Ics,Line,36}; -yystate(35, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> - yystate(39, Ics, Line, Tlen+1, Action, Alen); -yystate(35, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 70 -> - yystate(39, Ics, Line, Tlen+1, Action, Alen); -yystate(35, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 102 -> - yystate(39, Ics, Line, Tlen+1, Action, Alen); +yystate(35, [124|Ics], Line, Tlen, Action, Alen) -> + yystate(31, Ics, Line, Tlen+1, Action, Alen); +yystate(35, [120|Ics], Line, Tlen, Action, Alen) -> + yystate(27, Ics, Line, Tlen+1, Action, Alen); +yystate(35, [92|Ics], Line, Tlen, Action, Alen) -> + yystate(35, Ics, Line, Tlen+1, Action, Alen); +yystate(35, [10|Ics], Line, Tlen, Action, Alen) -> + yystate(43, Ics, Line+1, Tlen+1, Action, Alen); +yystate(35, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(35, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 91 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(35, [C|Ics], Line, Tlen, Action, Alen) when C >= 93, C =< 119 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(35, [C|Ics], Line, Tlen, Action, Alen) when C >= 121, C =< 123 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(35, [C|Ics], Line, Tlen, Action, Alen) when C >= 125 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); yystate(35, Ics, Line, Tlen, Action, Alen) -> {Action,Alen,Tlen,Ics,Line,35}; -yystate(34, [92|Ics], Line, Tlen, Action, Alen) -> - yystate(22, Ics, Line, Tlen+1, Action, Alen); -yystate(34, [34|Ics], Line, Tlen, Action, Alen) -> - yystate(30, Ics, Line, Tlen+1, Action, Alen); -yystate(34, [10|Ics], Line, Tlen, Action, Alen) -> - yystate(34, Ics, Line+1, Tlen+1, Action, Alen); -yystate(34, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(34, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 33 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(34, [C|Ics], Line, Tlen, Action, Alen) when C >= 35, C =< 91 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(34, [C|Ics], Line, Tlen, Action, Alen) when C >= 93 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(34, Ics, Line, Tlen, Action, Alen) -> - {Action,Alen,Tlen,Ics,Line,34}; -yystate(33, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> - yystate(33, Ics, Line, Tlen+1, 18, Tlen); +yystate(34, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 55 -> + yystate(34, Ics, Line, Tlen+1, 17, Tlen); +yystate(34, Ics, Line, Tlen, _, _) -> + {17,Tlen,Ics,Line,34}; +yystate(33, [92|Ics], Line, Tlen, _, _) -> + yystate(29, Ics, Line, Tlen+1, 14, Tlen); +yystate(33, [34|Ics], Line, Tlen, _, _) -> + yystate(37, Ics, Line, Tlen+1, 14, Tlen); +yystate(33, [10|Ics], Line, Tlen, _, _) -> + yystate(41, Ics, Line+1, Tlen+1, 14, Tlen); +yystate(33, [C|Ics], Line, Tlen, _, _) when C >= 0, C =< 9 -> + yystate(41, Ics, Line, Tlen+1, 14, Tlen); +yystate(33, [C|Ics], Line, Tlen, _, _) when C >= 11, C =< 33 -> + yystate(41, Ics, Line, Tlen+1, 14, Tlen); +yystate(33, [C|Ics], Line, Tlen, _, _) when C >= 35, C =< 91 -> + yystate(41, Ics, Line, Tlen+1, 14, Tlen); +yystate(33, [C|Ics], Line, Tlen, _, _) when C >= 93 -> + yystate(41, Ics, Line, Tlen+1, 14, Tlen); yystate(33, Ics, Line, Tlen, _, _) -> - {18,Tlen,Ics,Line,33}; + {14,Tlen,Ics,Line,33}; yystate(32, Ics, Line, Tlen, _, _) -> - {15,Tlen,Ics,Line}; + {7,Tlen,Ics,Line}; +yystate(31, [124|Ics], Line, Tlen, _, _) -> + yystate(39, Ics, Line, Tlen+1, 15, Tlen); +yystate(31, [92|Ics], Line, Tlen, _, _) -> + yystate(35, Ics, Line, Tlen+1, 15, Tlen); +yystate(31, [10|Ics], Line, Tlen, _, _) -> + yystate(43, Ics, Line+1, Tlen+1, 15, Tlen); +yystate(31, [C|Ics], Line, Tlen, _, _) when C >= 0, C =< 9 -> + yystate(43, Ics, Line, Tlen+1, 15, Tlen); +yystate(31, [C|Ics], Line, Tlen, _, _) when C >= 11, C =< 91 -> + yystate(43, Ics, Line, Tlen+1, 15, Tlen); +yystate(31, [C|Ics], Line, Tlen, _, _) when C >= 93, C =< 123 -> + yystate(43, Ics, Line, Tlen+1, 15, Tlen); +yystate(31, [C|Ics], Line, Tlen, _, _) when C >= 125 -> + yystate(43, Ics, Line, Tlen+1, 15, Tlen); yystate(31, Ics, Line, Tlen, _, _) -> - {13,Tlen,Ics,Line}; -yystate(30, Ics, Line, Tlen, _, _) -> - {14,Tlen,Ics,Line}; -yystate(29, [48|Ics], Line, Tlen, Action, Alen) -> - yystate(25, Ics, Line, Tlen+1, Action, Alen); -yystate(29, [49|Ics], Line, Tlen, Action, Alen) -> - yystate(25, Ics, Line, Tlen+1, Action, Alen); -yystate(29, [40|Ics], Line, Tlen, Action, Alen) -> + {15,Tlen,Ics,Line,31}; +yystate(30, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> + yystate(26, Ics, Line, Tlen+1, Action, Alen); +yystate(30, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,30}; +yystate(29, [120|Ics], Line, Tlen, Action, Alen) -> yystate(21, Ics, Line, Tlen+1, Action, Alen); +yystate(29, [92|Ics], Line, Tlen, Action, Alen) -> + yystate(29, Ics, Line, Tlen+1, Action, Alen); +yystate(29, [34|Ics], Line, Tlen, Action, Alen) -> + yystate(33, Ics, Line, Tlen+1, Action, Alen); +yystate(29, [10|Ics], Line, Tlen, Action, Alen) -> + yystate(41, Ics, Line+1, Tlen+1, Action, Alen); +yystate(29, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(29, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 33 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(29, [C|Ics], Line, Tlen, Action, Alen) when C >= 35, C =< 91 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(29, [C|Ics], Line, Tlen, Action, Alen) when C >= 93, C =< 119 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(29, [C|Ics], Line, Tlen, Action, Alen) when C >= 121 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); yystate(29, Ics, Line, Tlen, Action, Alen) -> {Action,Alen,Tlen,Ics,Line,29}; -yystate(28, [124|Ics], Line, Tlen, Action, Alen) -> - yystate(24, Ics, Line, Tlen+1, Action, Alen); -yystate(28, [120|Ics], Line, Tlen, Action, Alen) -> - yystate(20, Ics, Line, Tlen+1, Action, Alen); -yystate(28, [92|Ics], Line, Tlen, Action, Alen) -> - yystate(28, Ics, Line, Tlen+1, Action, Alen); -yystate(28, [10|Ics], Line, Tlen, Action, Alen) -> - yystate(36, Ics, Line+1, Tlen+1, Action, Alen); -yystate(28, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(28, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 91 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(28, [C|Ics], Line, Tlen, Action, Alen) when C >= 93, C =< 119 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(28, [C|Ics], Line, Tlen, Action, Alen) when C >= 121, C =< 123 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(28, [C|Ics], Line, Tlen, Action, Alen) when C >= 125 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(28, Ics, Line, Tlen, Action, Alen) -> - {Action,Alen,Tlen,Ics,Line,28}; -yystate(27, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> - yystate(27, Ics, Line, Tlen+1, 13, Tlen); -yystate(27, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 70 -> - yystate(27, Ics, Line, Tlen+1, 13, Tlen); -yystate(27, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 102 -> - yystate(27, Ics, Line, Tlen+1, 13, Tlen); -yystate(27, Ics, Line, Tlen, _, _) -> - {13,Tlen,Ics,Line,27}; -yystate(26, [92|Ics], Line, Tlen, _, _) -> - yystate(22, Ics, Line, Tlen+1, 14, Tlen); -yystate(26, [34|Ics], Line, Tlen, _, _) -> - yystate(30, Ics, Line, Tlen+1, 14, Tlen); -yystate(26, [10|Ics], Line, Tlen, _, _) -> - yystate(34, Ics, Line+1, Tlen+1, 14, Tlen); -yystate(26, [C|Ics], Line, Tlen, _, _) when C >= 0, C =< 9 -> - yystate(34, Ics, Line, Tlen+1, 14, Tlen); -yystate(26, [C|Ics], Line, Tlen, _, _) when C >= 11, C =< 33 -> - yystate(34, Ics, Line, Tlen+1, 14, Tlen); -yystate(26, [C|Ics], Line, Tlen, _, _) when C >= 35, C =< 91 -> - yystate(34, Ics, Line, Tlen+1, 14, Tlen); -yystate(26, [C|Ics], Line, Tlen, _, _) when C >= 93 -> - yystate(34, Ics, Line, Tlen+1, 14, Tlen); +yystate(28, Ics, Line, Tlen, _, _) -> + {12,Tlen,Ics,Line}; +yystate(27, [124|Ics], Line, Tlen, Action, Alen) -> + yystate(39, Ics, Line, Tlen+1, Action, Alen); +yystate(27, [92|Ics], Line, Tlen, Action, Alen) -> + yystate(35, Ics, Line, Tlen+1, Action, Alen); +yystate(27, [10|Ics], Line, Tlen, Action, Alen) -> + yystate(43, Ics, Line+1, Tlen+1, Action, Alen); +yystate(27, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(27, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 47 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(27, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> + yystate(23, Ics, Line, Tlen+1, Action, Alen); +yystate(27, [C|Ics], Line, Tlen, Action, Alen) when C >= 58, C =< 64 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(27, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 70 -> + yystate(23, Ics, Line, Tlen+1, Action, Alen); +yystate(27, [C|Ics], Line, Tlen, Action, Alen) when C >= 71, C =< 91 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(27, [C|Ics], Line, Tlen, Action, Alen) when C >= 93, C =< 96 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(27, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 102 -> + yystate(23, Ics, Line, Tlen+1, Action, Alen); +yystate(27, [C|Ics], Line, Tlen, Action, Alen) when C >= 103, C =< 123 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(27, [C|Ics], Line, Tlen, Action, Alen) when C >= 125 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(27, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,27}; +yystate(26, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(26, Ics, Line, Tlen+1, 18, Tlen); yystate(26, Ics, Line, Tlen, _, _) -> - {14,Tlen,Ics,Line,26}; -yystate(25, [48|Ics], Line, Tlen, _, _) -> - yystate(25, Ics, Line, Tlen+1, 16, Tlen); -yystate(25, [49|Ics], Line, Tlen, _, _) -> - yystate(25, Ics, Line, Tlen+1, 16, Tlen); -yystate(25, Ics, Line, Tlen, _, _) -> - {16,Tlen,Ics,Line,25}; + {18,Tlen,Ics,Line,26}; +yystate(25, [92|Ics], Line, Tlen, Action, Alen) -> + yystate(29, Ics, Line, Tlen+1, Action, Alen); +yystate(25, [59|Ics], Line, Tlen, Action, Alen) -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(25, [58|Ics], Line, Tlen, Action, Alen) -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(25, [34|Ics], Line, Tlen, Action, Alen) -> + yystate(37, Ics, Line, Tlen+1, Action, Alen); +yystate(25, [10|Ics], Line, Tlen, Action, Alen) -> + yystate(41, Ics, Line+1, Tlen+1, Action, Alen); +yystate(25, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(25, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 33 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(25, [C|Ics], Line, Tlen, Action, Alen) when C >= 35, C =< 47 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(25, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> + yystate(25, Ics, Line, Tlen+1, Action, Alen); +yystate(25, [C|Ics], Line, Tlen, Action, Alen) when C >= 60, C =< 64 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(25, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 70 -> + yystate(25, Ics, Line, Tlen+1, Action, Alen); +yystate(25, [C|Ics], Line, Tlen, Action, Alen) when C >= 71, C =< 91 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(25, [C|Ics], Line, Tlen, Action, Alen) when C >= 93, C =< 96 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(25, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 102 -> + yystate(25, Ics, Line, Tlen+1, Action, Alen); +yystate(25, [C|Ics], Line, Tlen, Action, Alen) when C >= 103 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(25, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,25}; yystate(24, [124|Ics], Line, Tlen, _, _) -> - yystate(32, Ics, Line, Tlen+1, 15, Tlen); + yystate(45, Ics, Line, Tlen+1, 23, Tlen); yystate(24, [92|Ics], Line, Tlen, _, _) -> - yystate(28, Ics, Line, Tlen+1, 15, Tlen); -yystate(24, [10|Ics], Line, Tlen, _, _) -> - yystate(36, Ics, Line+1, Tlen+1, 15, Tlen); -yystate(24, [C|Ics], Line, Tlen, _, _) when C >= 0, C =< 9 -> - yystate(36, Ics, Line, Tlen+1, 15, Tlen); -yystate(24, [C|Ics], Line, Tlen, _, _) when C >= 11, C =< 91 -> - yystate(36, Ics, Line, Tlen+1, 15, Tlen); -yystate(24, [C|Ics], Line, Tlen, _, _) when C >= 93, C =< 123 -> - yystate(36, Ics, Line, Tlen+1, 15, Tlen); -yystate(24, [C|Ics], Line, Tlen, _, _) when C >= 125 -> - yystate(36, Ics, Line, Tlen+1, 15, Tlen); + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(24, [58|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(24, [33|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(24, [C|Ics], Line, Tlen, _, _) when C >= 35, C =< 39 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(24, [C|Ics], Line, Tlen, _, _) when C >= 42, C =< 47 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(24, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(11, Ics, Line, Tlen+1, 23, Tlen); +yystate(24, [C|Ics], Line, Tlen, _, _) when C >= 60, C =< 90 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(24, [C|Ics], Line, Tlen, _, _) when C >= 94, C =< 122 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(24, [C|Ics], Line, Tlen, _, _) when C >= 126 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); yystate(24, Ics, Line, Tlen, _, _) -> - {15,Tlen,Ics,Line,24}; -yystate(23, [120|Ics], Line, Tlen, Action, Alen) -> - yystate(27, Ics, Line, Tlen+1, Action, Alen); + {23,Tlen,Ics,Line,24}; +yystate(23, [124|Ics], Line, Tlen, Action, Alen) -> + yystate(39, Ics, Line, Tlen+1, Action, Alen); +yystate(23, [92|Ics], Line, Tlen, Action, Alen) -> + yystate(35, Ics, Line, Tlen+1, Action, Alen); +yystate(23, [59|Ics], Line, Tlen, Action, Alen) -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(23, [58|Ics], Line, Tlen, Action, Alen) -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(23, [10|Ics], Line, Tlen, Action, Alen) -> + yystate(43, Ics, Line+1, Tlen+1, Action, Alen); yystate(23, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> - yystate(31, Ics, Line, Tlen+1, Action, Alen); -yystate(23, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 119 -> - yystate(31, Ics, Line, Tlen+1, Action, Alen); -yystate(23, [C|Ics], Line, Tlen, Action, Alen) when C >= 121 -> - yystate(31, Ics, Line, Tlen+1, Action, Alen); + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(23, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 47 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(23, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> + yystate(23, Ics, Line, Tlen+1, Action, Alen); +yystate(23, [C|Ics], Line, Tlen, Action, Alen) when C >= 60, C =< 64 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(23, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 70 -> + yystate(23, Ics, Line, Tlen+1, Action, Alen); +yystate(23, [C|Ics], Line, Tlen, Action, Alen) when C >= 71, C =< 91 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(23, [C|Ics], Line, Tlen, Action, Alen) when C >= 93, C =< 96 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(23, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 102 -> + yystate(23, Ics, Line, Tlen+1, Action, Alen); +yystate(23, [C|Ics], Line, Tlen, Action, Alen) when C >= 103, C =< 123 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(23, [C|Ics], Line, Tlen, Action, Alen) when C >= 125 -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); yystate(23, Ics, Line, Tlen, Action, Alen) -> {Action,Alen,Tlen,Ics,Line,23}; -yystate(22, [120|Ics], Line, Tlen, Action, Alen) -> +yystate(22, [48|Ics], Line, Tlen, Action, Alen) -> + yystate(18, Ics, Line, Tlen+1, Action, Alen); +yystate(22, [49|Ics], Line, Tlen, Action, Alen) -> + yystate(18, Ics, Line, Tlen+1, Action, Alen); +yystate(22, [40|Ics], Line, Tlen, Action, Alen) -> yystate(14, Ics, Line, Tlen+1, Action, Alen); -yystate(22, [92|Ics], Line, Tlen, Action, Alen) -> - yystate(22, Ics, Line, Tlen+1, Action, Alen); -yystate(22, [34|Ics], Line, Tlen, Action, Alen) -> - yystate(26, Ics, Line, Tlen+1, Action, Alen); -yystate(22, [10|Ics], Line, Tlen, Action, Alen) -> - yystate(34, Ics, Line+1, Tlen+1, Action, Alen); -yystate(22, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(22, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 33 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(22, [C|Ics], Line, Tlen, Action, Alen) when C >= 35, C =< 91 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(22, [C|Ics], Line, Tlen, Action, Alen) when C >= 93, C =< 119 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(22, [C|Ics], Line, Tlen, Action, Alen) when C >= 121 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); yystate(22, Ics, Line, Tlen, Action, Alen) -> {Action,Alen,Tlen,Ics,Line,22}; -yystate(21, Ics, Line, Tlen, _, _) -> - {0,Tlen,Ics,Line}; -yystate(20, [124|Ics], Line, Tlen, Action, Alen) -> - yystate(32, Ics, Line, Tlen+1, Action, Alen); -yystate(20, [92|Ics], Line, Tlen, Action, Alen) -> - yystate(28, Ics, Line, Tlen+1, Action, Alen); -yystate(20, [10|Ics], Line, Tlen, Action, Alen) -> - yystate(36, Ics, Line+1, Tlen+1, Action, Alen); -yystate(20, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(20, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 47 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(20, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> - yystate(16, Ics, Line, Tlen+1, Action, Alen); -yystate(20, [C|Ics], Line, Tlen, Action, Alen) when C >= 58, C =< 64 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(20, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 70 -> - yystate(16, Ics, Line, Tlen+1, Action, Alen); -yystate(20, [C|Ics], Line, Tlen, Action, Alen) when C >= 71, C =< 91 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(20, [C|Ics], Line, Tlen, Action, Alen) when C >= 93, C =< 96 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(20, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 102 -> - yystate(16, Ics, Line, Tlen+1, Action, Alen); -yystate(20, [C|Ics], Line, Tlen, Action, Alen) when C >= 103, C =< 123 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(20, [C|Ics], Line, Tlen, Action, Alen) when C >= 125 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(20, Ics, Line, Tlen, Action, Alen) -> - {Action,Alen,Tlen,Ics,Line,20}; -yystate(19, Ics, Line, Tlen, _, _) -> - {3,Tlen,Ics,Line}; -yystate(18, [92|Ics], Line, Tlen, Action, Alen) -> - yystate(22, Ics, Line, Tlen+1, Action, Alen); -yystate(18, [59|Ics], Line, Tlen, Action, Alen) -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(18, [58|Ics], Line, Tlen, Action, Alen) -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(18, [34|Ics], Line, Tlen, Action, Alen) -> - yystate(30, Ics, Line, Tlen+1, Action, Alen); -yystate(18, [10|Ics], Line, Tlen, Action, Alen) -> - yystate(34, Ics, Line+1, Tlen+1, Action, Alen); -yystate(18, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(18, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 33 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(18, [C|Ics], Line, Tlen, Action, Alen) when C >= 35, C =< 47 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(18, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> - yystate(18, Ics, Line, Tlen+1, Action, Alen); -yystate(18, [C|Ics], Line, Tlen, Action, Alen) when C >= 60, C =< 64 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(18, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 70 -> - yystate(18, Ics, Line, Tlen+1, Action, Alen); -yystate(18, [C|Ics], Line, Tlen, Action, Alen) when C >= 71, C =< 91 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(18, [C|Ics], Line, Tlen, Action, Alen) when C >= 93, C =< 96 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(18, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 102 -> - yystate(18, Ics, Line, Tlen+1, Action, Alen); -yystate(18, [C|Ics], Line, Tlen, Action, Alen) when C >= 103 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(18, Ics, Line, Tlen, Action, Alen) -> - {Action,Alen,Tlen,Ics,Line,18}; -yystate(17, Ics, Line, Tlen, _, _) -> - {4,Tlen,Ics,Line}; -yystate(16, [124|Ics], Line, Tlen, Action, Alen) -> - yystate(32, Ics, Line, Tlen+1, Action, Alen); -yystate(16, [92|Ics], Line, Tlen, Action, Alen) -> - yystate(28, Ics, Line, Tlen+1, Action, Alen); -yystate(16, [59|Ics], Line, Tlen, Action, Alen) -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(16, [58|Ics], Line, Tlen, Action, Alen) -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(16, [10|Ics], Line, Tlen, Action, Alen) -> - yystate(36, Ics, Line+1, Tlen+1, Action, Alen); -yystate(16, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(16, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 47 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(16, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> - yystate(16, Ics, Line, Tlen+1, Action, Alen); -yystate(16, [C|Ics], Line, Tlen, Action, Alen) when C >= 60, C =< 64 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(16, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 70 -> - yystate(16, Ics, Line, Tlen+1, Action, Alen); -yystate(16, [C|Ics], Line, Tlen, Action, Alen) when C >= 71, C =< 91 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(16, [C|Ics], Line, Tlen, Action, Alen) when C >= 93, C =< 96 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(16, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 102 -> - yystate(16, Ics, Line, Tlen+1, Action, Alen); -yystate(16, [C|Ics], Line, Tlen, Action, Alen) when C >= 103, C =< 123 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(16, [C|Ics], Line, Tlen, Action, Alen) when C >= 125 -> - yystate(36, Ics, Line, Tlen+1, Action, Alen); -yystate(16, Ics, Line, Tlen, Action, Alen) -> - {Action,Alen,Tlen,Ics,Line,16}; -yystate(15, [120|Ics], Line, Tlen, Action, Alen) -> - yystate(35, Ics, Line, Tlen+1, Action, Alen); -yystate(15, [111|Ics], Line, Tlen, Action, Alen) -> - yystate(43, Ics, Line, Tlen+1, Action, Alen); -yystate(15, [100|Ics], Line, Tlen, Action, Alen) -> - yystate(37, Ics, Line, Tlen+1, Action, Alen); -yystate(15, [98|Ics], Line, Tlen, Action, Alen) -> +yystate(21, [92|Ics], Line, Tlen, Action, Alen) -> yystate(29, Ics, Line, Tlen+1, Action, Alen); -yystate(15, [96|Ics], Line, Tlen, Action, Alen) -> - yystate(19, Ics, Line, Tlen+1, Action, Alen); -yystate(15, [92|Ics], Line, Tlen, Action, Alen) -> - yystate(23, Ics, Line, Tlen+1, Action, Alen); -yystate(15, [88|Ics], Line, Tlen, Action, Alen) -> - yystate(35, Ics, Line, Tlen+1, Action, Alen); -yystate(15, [79|Ics], Line, Tlen, Action, Alen) -> - yystate(43, Ics, Line, Tlen+1, Action, Alen); -yystate(15, [68|Ics], Line, Tlen, Action, Alen) -> +yystate(21, [34|Ics], Line, Tlen, Action, Alen) -> yystate(37, Ics, Line, Tlen+1, Action, Alen); -yystate(15, [66|Ics], Line, Tlen, Action, Alen) -> - yystate(29, Ics, Line, Tlen+1, Action, Alen); -yystate(15, [59|Ics], Line, Tlen, Action, Alen) -> - yystate(17, Ics, Line, Tlen+1, Action, Alen); -yystate(15, [44|Ics], Line, Tlen, Action, Alen) -> - yystate(1, Ics, Line, Tlen+1, Action, Alen); -yystate(15, [40|Ics], Line, Tlen, Action, Alen) -> - yystate(6, Ics, Line, Tlen+1, Action, Alen); -yystate(15, [39|Ics], Line, Tlen, Action, Alen) -> - yystate(10, Ics, Line, Tlen+1, Action, Alen); -yystate(15, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> - yystate(13, Ics, Line, Tlen+1, Action, Alen); -yystate(15, Ics, Line, Tlen, Action, Alen) -> - {Action,Alen,Tlen,Ics,Line,15}; -yystate(14, [92|Ics], Line, Tlen, Action, Alen) -> - yystate(22, Ics, Line, Tlen+1, Action, Alen); -yystate(14, [34|Ics], Line, Tlen, Action, Alen) -> - yystate(30, Ics, Line, Tlen+1, Action, Alen); -yystate(14, [10|Ics], Line, Tlen, Action, Alen) -> - yystate(34, Ics, Line+1, Tlen+1, Action, Alen); -yystate(14, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(14, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 33 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(14, [C|Ics], Line, Tlen, Action, Alen) when C >= 35, C =< 47 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(14, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> - yystate(18, Ics, Line, Tlen+1, Action, Alen); -yystate(14, [C|Ics], Line, Tlen, Action, Alen) when C >= 58, C =< 64 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(14, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 70 -> - yystate(18, Ics, Line, Tlen+1, Action, Alen); -yystate(14, [C|Ics], Line, Tlen, Action, Alen) when C >= 71, C =< 91 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(14, [C|Ics], Line, Tlen, Action, Alen) when C >= 93, C =< 96 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(14, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 102 -> - yystate(18, Ics, Line, Tlen+1, Action, Alen); -yystate(14, [C|Ics], Line, Tlen, Action, Alen) when C >= 103 -> - yystate(34, Ics, Line, Tlen+1, Action, Alen); -yystate(14, Ics, Line, Tlen, Action, Alen) -> - {Action,Alen,Tlen,Ics,Line,14}; -yystate(13, [114|Ics], Line, Tlen, Action, Alen) -> - yystate(9, Ics, Line, Tlen+1, Action, Alen); -yystate(13, [82|Ics], Line, Tlen, Action, Alen) -> - yystate(9, Ics, Line, Tlen+1, Action, Alen); -yystate(13, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> - yystate(13, Ics, Line, Tlen+1, Action, Alen); -yystate(13, Ics, Line, Tlen, Action, Alen) -> - {Action,Alen,Tlen,Ics,Line,13}; -yystate(12, Ics, Line, Tlen, _, _) -> +yystate(21, [10|Ics], Line, Tlen, Action, Alen) -> + yystate(41, Ics, Line+1, Tlen+1, Action, Alen); +yystate(21, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(21, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 33 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(21, [C|Ics], Line, Tlen, Action, Alen) when C >= 35, C =< 47 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(21, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> + yystate(25, Ics, Line, Tlen+1, Action, Alen); +yystate(21, [C|Ics], Line, Tlen, Action, Alen) when C >= 58, C =< 64 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(21, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 70 -> + yystate(25, Ics, Line, Tlen+1, Action, Alen); +yystate(21, [C|Ics], Line, Tlen, Action, Alen) when C >= 71, C =< 91 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(21, [C|Ics], Line, Tlen, Action, Alen) when C >= 93, C =< 96 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(21, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 102 -> + yystate(25, Ics, Line, Tlen+1, Action, Alen); +yystate(21, [C|Ics], Line, Tlen, Action, Alen) when C >= 103 -> + yystate(41, Ics, Line, Tlen+1, Action, Alen); +yystate(21, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,21}; +yystate(20, Ics, Line, Tlen, _, _) -> + {10,Tlen,Ics,Line}; +yystate(19, Ics, Line, Tlen, _, _) -> {8,Tlen,Ics,Line}; +yystate(18, [48|Ics], Line, Tlen, _, _) -> + yystate(18, Ics, Line, Tlen+1, 16, Tlen); +yystate(18, [49|Ics], Line, Tlen, _, _) -> + yystate(18, Ics, Line, Tlen+1, 16, Tlen); +yystate(18, Ics, Line, Tlen, _, _) -> + {16,Tlen,Ics,Line,18}; +yystate(17, Ics, Line, Tlen, _, _) -> + {2,Tlen,Ics,Line}; +yystate(16, [64|Ics], Line, Tlen, _, _) -> + yystate(20, Ics, Line, Tlen+1, 9, Tlen); +yystate(16, Ics, Line, Tlen, _, _) -> + {9,Tlen,Ics,Line,16}; +yystate(15, [59|Ics], Line, Tlen, _, _) -> + yystate(15, Ics, Line, Tlen+1, 24, Tlen); +yystate(15, [10|Ics], Line, Tlen, _, _) -> + yystate(49, Ics, Line+1, Tlen+1, 24, Tlen); +yystate(15, [C|Ics], Line, Tlen, _, _) when C >= 0, C =< 9 -> + yystate(15, Ics, Line, Tlen+1, 24, Tlen); +yystate(15, [C|Ics], Line, Tlen, _, _) when C >= 11, C =< 32 -> + yystate(15, Ics, Line, Tlen+1, 24, Tlen); +yystate(15, [C|Ics], Line, Tlen, _, _) when C >= 33, C =< 58 -> + yystate(15, Ics, Line, Tlen+1, 24, Tlen); +yystate(15, [C|Ics], Line, Tlen, _, _) when C >= 60 -> + yystate(15, Ics, Line, Tlen+1, 24, Tlen); +yystate(15, Ics, Line, Tlen, _, _) -> + {24,Tlen,Ics,Line,15}; +yystate(14, Ics, Line, Tlen, _, _) -> + {0,Tlen,Ics,Line}; +yystate(13, Ics, Line, Tlen, _, _) -> + {1,Tlen,Ics,Line}; +yystate(12, [124|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 11, Tlen); +yystate(12, [92|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 11, Tlen); +yystate(12, [33|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 11, Tlen); +yystate(12, [C|Ics], Line, Tlen, _, _) when C >= 35, C =< 39 -> + yystate(45, Ics, Line, Tlen+1, 11, Tlen); +yystate(12, [C|Ics], Line, Tlen, _, _) when C >= 42, C =< 58 -> + yystate(45, Ics, Line, Tlen+1, 11, Tlen); +yystate(12, [C|Ics], Line, Tlen, _, _) when C >= 60, C =< 90 -> + yystate(45, Ics, Line, Tlen+1, 11, Tlen); +yystate(12, [C|Ics], Line, Tlen, _, _) when C >= 94, C =< 122 -> + yystate(45, Ics, Line, Tlen+1, 11, Tlen); +yystate(12, [C|Ics], Line, Tlen, _, _) when C >= 126 -> + yystate(45, Ics, Line, Tlen+1, 11, Tlen); +yystate(12, Ics, Line, Tlen, _, _) -> + {11,Tlen,Ics,Line,12}; +yystate(11, [124|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 21, Tlen); +yystate(11, [92|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 21, Tlen); +yystate(11, [58|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 21, Tlen); +yystate(11, [47|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 21, Tlen); +yystate(11, [46|Ics], Line, Tlen, _, _) -> + yystate(7, Ics, Line, Tlen+1, 21, Tlen); +yystate(11, [33|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 21, Tlen); +yystate(11, [C|Ics], Line, Tlen, _, _) when C >= 35, C =< 39 -> + yystate(45, Ics, Line, Tlen+1, 21, Tlen); +yystate(11, [C|Ics], Line, Tlen, _, _) when C >= 42, C =< 45 -> + yystate(45, Ics, Line, Tlen+1, 21, Tlen); +yystate(11, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(11, Ics, Line, Tlen+1, 21, Tlen); +yystate(11, [C|Ics], Line, Tlen, _, _) when C >= 60, C =< 90 -> + yystate(45, Ics, Line, Tlen+1, 21, Tlen); +yystate(11, [C|Ics], Line, Tlen, _, _) when C >= 94, C =< 122 -> + yystate(45, Ics, Line, Tlen+1, 21, Tlen); +yystate(11, [C|Ics], Line, Tlen, _, _) when C >= 126 -> + yystate(45, Ics, Line, Tlen+1, 21, Tlen); yystate(11, Ics, Line, Tlen, _, _) -> - {7,Tlen,Ics,Line}; + {21,Tlen,Ics,Line,11}; yystate(10, Ics, Line, Tlen, _, _) -> - {2,Tlen,Ics,Line}; -yystate(9, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> - yystate(5, Ics, Line, Tlen+1, Action, Alen); -yystate(9, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 90 -> - yystate(5, Ics, Line, Tlen+1, Action, Alen); -yystate(9, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 122 -> - yystate(5, Ics, Line, Tlen+1, Action, Alen); -yystate(9, Ics, Line, Tlen, Action, Alen) -> - {Action,Alen,Tlen,Ics,Line,9}; -yystate(8, [59|Ics], Line, Tlen, _, _) -> - yystate(8, Ics, Line, Tlen+1, 22, Tlen); -yystate(8, [10|Ics], Line, Tlen, _, _) -> - yystate(42, Ics, Line+1, Tlen+1, 22, Tlen); -yystate(8, [C|Ics], Line, Tlen, _, _) when C >= 0, C =< 9 -> - yystate(8, Ics, Line, Tlen+1, 22, Tlen); -yystate(8, [C|Ics], Line, Tlen, _, _) when C >= 11, C =< 32 -> - yystate(8, Ics, Line, Tlen+1, 22, Tlen); -yystate(8, [C|Ics], Line, Tlen, _, _) when C >= 33, C =< 58 -> - yystate(8, Ics, Line, Tlen+1, 22, Tlen); -yystate(8, [C|Ics], Line, Tlen, _, _) when C >= 60 -> - yystate(8, Ics, Line, Tlen+1, 22, Tlen); + {4,Tlen,Ics,Line}; +yystate(9, Ics, Line, Tlen, _, _) -> + {6,Tlen,Ics,Line}; +yystate(8, [124|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(8, [92|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(8, [58|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(8, [33|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(8, [C|Ics], Line, Tlen, _, _) when C >= 35, C =< 39 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(8, [C|Ics], Line, Tlen, _, _) when C >= 42, C =< 47 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(8, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(4, Ics, Line, Tlen+1, 23, Tlen); +yystate(8, [C|Ics], Line, Tlen, _, _) when C >= 60, C =< 90 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(8, [C|Ics], Line, Tlen, _, _) when C >= 94, C =< 122 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(8, [C|Ics], Line, Tlen, _, _) when C >= 126 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); yystate(8, Ics, Line, Tlen, _, _) -> - {22,Tlen,Ics,Line,8}; + {23,Tlen,Ics,Line,8}; +yystate(7, [124|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(7, [92|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(7, [58|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(7, [33|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(7, [C|Ics], Line, Tlen, _, _) when C >= 35, C =< 39 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(7, [C|Ics], Line, Tlen, _, _) when C >= 42, C =< 47 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(7, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(3, Ics, Line, Tlen+1, 23, Tlen); +yystate(7, [C|Ics], Line, Tlen, _, _) when C >= 60, C =< 90 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(7, [C|Ics], Line, Tlen, _, _) when C >= 94, C =< 122 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(7, [C|Ics], Line, Tlen, _, _) when C >= 126 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); yystate(7, Ics, Line, Tlen, _, _) -> - {12,Tlen,Ics,Line}; -yystate(6, Ics, Line, Tlen, _, _) -> - {1,Tlen,Ics,Line}; -yystate(5, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> - yystate(5, Ics, Line, Tlen+1, 20, Tlen); -yystate(5, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> - yystate(5, Ics, Line, Tlen+1, 20, Tlen); -yystate(5, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> - yystate(5, Ics, Line, Tlen+1, 20, Tlen); + {23,Tlen,Ics,Line,7}; +yystate(6, [114|Ics], Line, Tlen, Action, Alen) -> + yystate(2, Ics, Line, Tlen+1, Action, Alen); +yystate(6, [82|Ics], Line, Tlen, Action, Alen) -> + yystate(2, Ics, Line, Tlen+1, Action, Alen); +yystate(6, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> + yystate(6, Ics, Line, Tlen+1, Action, Alen); +yystate(6, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,6}; +yystate(5, [64|Ics], Line, Tlen, _, _) -> + yystate(9, Ics, Line, Tlen+1, 5, Tlen); yystate(5, Ics, Line, Tlen, _, _) -> - {20,Tlen,Ics,Line,5}; + {5,Tlen,Ics,Line,5}; yystate(4, [124|Ics], Line, Tlen, _, _) -> - yystate(38, Ics, Line, Tlen+1, 11, Tlen); + yystate(45, Ics, Line, Tlen+1, 22, Tlen); yystate(4, [92|Ics], Line, Tlen, _, _) -> - yystate(38, Ics, Line, Tlen+1, 11, Tlen); + yystate(45, Ics, Line, Tlen+1, 22, Tlen); +yystate(4, [58|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 22, Tlen); yystate(4, [33|Ics], Line, Tlen, _, _) -> - yystate(38, Ics, Line, Tlen+1, 11, Tlen); + yystate(45, Ics, Line, Tlen+1, 22, Tlen); yystate(4, [C|Ics], Line, Tlen, _, _) when C >= 35, C =< 39 -> - yystate(38, Ics, Line, Tlen+1, 11, Tlen); -yystate(4, [C|Ics], Line, Tlen, _, _) when C >= 42, C =< 58 -> - yystate(38, Ics, Line, Tlen+1, 11, Tlen); + yystate(45, Ics, Line, Tlen+1, 22, Tlen); +yystate(4, [C|Ics], Line, Tlen, _, _) when C >= 42, C =< 47 -> + yystate(45, Ics, Line, Tlen+1, 22, Tlen); +yystate(4, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(4, Ics, Line, Tlen+1, 22, Tlen); yystate(4, [C|Ics], Line, Tlen, _, _) when C >= 60, C =< 90 -> - yystate(38, Ics, Line, Tlen+1, 11, Tlen); + yystate(45, Ics, Line, Tlen+1, 22, Tlen); yystate(4, [C|Ics], Line, Tlen, _, _) when C >= 94, C =< 122 -> - yystate(38, Ics, Line, Tlen+1, 11, Tlen); + yystate(45, Ics, Line, Tlen+1, 22, Tlen); yystate(4, [C|Ics], Line, Tlen, _, _) when C >= 126 -> - yystate(38, Ics, Line, Tlen+1, 11, Tlen); + yystate(45, Ics, Line, Tlen+1, 22, Tlen); yystate(4, Ics, Line, Tlen, _, _) -> - {11,Tlen,Ics,Line,4}; + {22,Tlen,Ics,Line,4}; +yystate(3, [124|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 22, Tlen); +yystate(3, [101|Ics], Line, Tlen, _, _) -> + yystate(0, Ics, Line, Tlen+1, 22, Tlen); +yystate(3, [92|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 22, Tlen); +yystate(3, [69|Ics], Line, Tlen, _, _) -> + yystate(0, Ics, Line, Tlen+1, 22, Tlen); +yystate(3, [58|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 22, Tlen); +yystate(3, [33|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 22, Tlen); +yystate(3, [C|Ics], Line, Tlen, _, _) when C >= 35, C =< 39 -> + yystate(45, Ics, Line, Tlen+1, 22, Tlen); +yystate(3, [C|Ics], Line, Tlen, _, _) when C >= 42, C =< 47 -> + yystate(45, Ics, Line, Tlen+1, 22, Tlen); +yystate(3, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(3, Ics, Line, Tlen+1, 22, Tlen); +yystate(3, [C|Ics], Line, Tlen, _, _) when C >= 60, C =< 68 -> + yystate(45, Ics, Line, Tlen+1, 22, Tlen); +yystate(3, [C|Ics], Line, Tlen, _, _) when C >= 70, C =< 90 -> + yystate(45, Ics, Line, Tlen+1, 22, Tlen); +yystate(3, [C|Ics], Line, Tlen, _, _) when C >= 94, C =< 100 -> + yystate(45, Ics, Line, Tlen+1, 22, Tlen); +yystate(3, [C|Ics], Line, Tlen, _, _) when C >= 102, C =< 122 -> + yystate(45, Ics, Line, Tlen+1, 22, Tlen); +yystate(3, [C|Ics], Line, Tlen, _, _) when C >= 126 -> + yystate(45, Ics, Line, Tlen+1, 22, Tlen); yystate(3, Ics, Line, Tlen, _, _) -> - {10,Tlen,Ics,Line}; -yystate(2, Ics, Line, Tlen, _, _) -> - {6,Tlen,Ics,Line}; -yystate(1, [64|Ics], Line, Tlen, _, _) -> - yystate(2, Ics, Line, Tlen+1, 5, Tlen); + {22,Tlen,Ics,Line,3}; +yystate(2, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> + yystate(1, Ics, Line, Tlen+1, Action, Alen); +yystate(2, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 90 -> + yystate(1, Ics, Line, Tlen+1, Action, Alen); +yystate(2, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 122 -> + yystate(1, Ics, Line, Tlen+1, Action, Alen); +yystate(2, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,2}; +yystate(1, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(1, Ics, Line, Tlen+1, 20, Tlen); +yystate(1, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(1, Ics, Line, Tlen+1, 20, Tlen); +yystate(1, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(1, Ics, Line, Tlen+1, 20, Tlen); yystate(1, Ics, Line, Tlen, _, _) -> - {5,Tlen,Ics,Line,1}; -yystate(0, [64|Ics], Line, Tlen, _, _) -> - yystate(3, Ics, Line, Tlen+1, 9, Tlen); + {20,Tlen,Ics,Line,1}; +yystate(0, [124|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(0, [92|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(0, [58|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(0, [46|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(0, [47|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(0, [45|Ics], Line, Tlen, _, _) -> + yystate(8, Ics, Line, Tlen+1, 23, Tlen); +yystate(0, [44|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(0, [43|Ics], Line, Tlen, _, _) -> + yystate(8, Ics, Line, Tlen+1, 23, Tlen); +yystate(0, [42|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(0, [33|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(0, [C|Ics], Line, Tlen, _, _) when C >= 35, C =< 39 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(0, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(4, Ics, Line, Tlen+1, 23, Tlen); +yystate(0, [C|Ics], Line, Tlen, _, _) when C >= 60, C =< 90 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(0, [C|Ics], Line, Tlen, _, _) when C >= 94, C =< 122 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); +yystate(0, [C|Ics], Line, Tlen, _, _) when C >= 126 -> + yystate(45, Ics, Line, Tlen+1, 23, Tlen); yystate(0, Ics, Line, Tlen, _, _) -> - {9,Tlen,Ics,Line,0}; + {23,Tlen,Ics,Line,0}; yystate(S, Ics, Line, Tlen, Action, Alen) -> {Action,Alen,Tlen,Ics,Line,S}. @@ -932,8 +1112,14 @@ yyaction(20, TokenLen, YYtcs, TokenLine) -> yyaction(21, TokenLen, YYtcs, TokenLine) -> TokenChars = yypre(YYtcs, TokenLen), yyaction_21(TokenChars, TokenLine); -yyaction(22, _, _, _) -> - yyaction_22(); +yyaction(22, TokenLen, YYtcs, TokenLine) -> + TokenChars = yypre(YYtcs, TokenLen), + yyaction_22(TokenChars, TokenLine); +yyaction(23, TokenLen, YYtcs, TokenLine) -> + TokenChars = yypre(YYtcs, TokenLen), + yyaction_23(TokenChars, TokenLine); +yyaction(24, _, _, _) -> + yyaction_24(); yyaction(_, _, _, _) -> error. -compile({inline,yyaction_0/1}). @@ -1047,18 +1233,30 @@ yyaction_20(TokenChars, TokenLine) -> -compile({inline,yyaction_21/2}). -file("src/lfe_scan.xrl", 80). yyaction_21(TokenChars, TokenLine) -> - case catch { ok, list_to_float (TokenChars) } of - { ok, F } -> { token, { number, TokenLine, F } } ; - _ -> case catch { ok, list_to_integer (TokenChars) } of { ok, I } -> { token, { number, TokenLine, I } } ; - _ -> { token, { symbol, TokenLine, list_to_atom (TokenChars) } } - end + _ -> { error, "illegal integer" } + end . + +-compile({inline,yyaction_22/2}). +-file("src/lfe_scan.xrl", 85). +yyaction_22(TokenChars, TokenLine) -> + case catch { ok, list_to_float (TokenChars) } of + { ok, F } -> { token, { number, TokenLine, F } } ; + _ -> { error, "illegal float" } + end . + +-compile({inline,yyaction_23/2}). +-file("src/lfe_scan.xrl", 90). +yyaction_23(TokenChars, TokenLine) -> + case catch { ok, list_to_atom (TokenChars) } of + { ok, S } -> { token, { symbol, TokenLine, S } } ; + _ -> { error, "illegal symbol" } end . --compile({inline,yyaction_22/0}). --file("src/lfe_scan.xrl", 88). -yyaction_22() -> +-compile({inline,yyaction_24/0}). +-file("src/lfe_scan.xrl", 94). +yyaction_24() -> skip_token . --file("/usr/local/lib/erlang/lib/parsetools-2.0.1/include/leexinc.hrl", 282). +-file("/usr/local/lib/erlang/lib/parsetools-2.0.3/include/leexinc.hrl", 282). diff --git a/src/lfe_scan.xrl b/src/lfe_scan.xrl index 3cb19cba..539b7c6b 100644 --- a/src/lfe_scan.xrl +++ b/src/lfe_scan.xrl @@ -78,14 +78,20 @@ Rules. {Base,[_|Ds]} = base1(string:substr(TokenChars, 2), 10, 0), base(Ds, Base, TokenLine). %% Atoms -{SSYM}{SYM}* : +[+-]?{D}+ : + case catch {ok,list_to_integer(TokenChars)} of + {ok,I} -> {token,{number,TokenLine,I}}; + _ -> {error,"illegal integer"} + end. +[+-]?{D}+\.{D}+([eE][+-]?{D}+)? : case catch {ok,list_to_float(TokenChars)} of {ok,F} -> {token,{number,TokenLine,F}}; - _ -> - case catch {ok,list_to_integer(TokenChars)} of - {ok,I} -> {token,{number,TokenLine,I}}; - _ -> {token,{symbol,TokenLine,list_to_atom(TokenChars)}} - end + _ -> {error,"illegal float"} + end. +{SSYM}{SYM}* : + case catch {ok,list_to_atom(TokenChars)} of + {ok,S} -> {token,{symbol,TokenLine,S}}; + _ -> {error,"illegal symbol"} end. {WS}+ : skip_token. From ff341c23725893b034d3d0d7884011ca6d8fa616 Mon Sep 17 00:00:00 2001 From: Robert Virding Date: Sun, 18 Jul 2010 04:07:49 +0200 Subject: [PATCH 3/4] Stripped trailing blanks. --- test/guard_SUITE.lfe | 33 ++++++++++++++++----------------- test/visual/test_macro.lfe | 2 +- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/test/guard_SUITE.lfe b/test/guard_SUITE.lfe index f2612785..d9b1da36 100644 --- a/test/guard_SUITE.lfe +++ b/test/guard_SUITE.lfe @@ -67,15 +67,15 @@ )) (defun all - (['suite] + (['suite] ;; test_lib:recompile(?MODULE), - (list 'misc 'const_cond 'basic_not 'complex_not 'nested_nots + (list 'misc 'const_cond 'basic_not 'complex_not 'nested_nots 'comma 'or_guard 'more_or_guards 'complex_or_guards - 'and_guard - 'xor_guard 'more_xor_guards - 'build_in_guard 'gbif + 'and_guard + 'xor_guard 'more_xor_guards + 'build_in_guard 'gbif 't_is_boolean 'is_function_2 'tricky 'rel_ops - ;; 'literal_type_tests + ;; 'literal_type_tests 'basic_andalso_orelse 'traverse_dcd 'check_qlc_hrl 'andalso_semi 'tup_size))) @@ -101,7 +101,7 @@ (line (test-pat (tuple 'ok 'buf #b()) (get_data #(o false 0) 0 'buf))) (line (test-pat 'error (get_data #(o false 0) 42 'buf))) 'ok)) - + (defun misc_1 ([((tuple w) (tuple x) (tuple y) (tuple z))] (eif (andalso (> x y) (=:= (abs z) 2)) (id w) @@ -188,7 +188,7 @@ #(a false)) 'ok 'true 'error)) 'ok)) (line (check (lambda () (eif (== (tuple 'a (not (element 1 atuple))) #(a false)) 'ok 'true 'error)) 'error)) - + (line (check (lambda () (eif (not (or (element 1 atuple) (element 3 atuple))) 'ok 'true 'error)) 'error)) @@ -235,7 +235,7 @@ (not (is_atom z))))))) 'true) ([_ _ _ _] 'false)) - + ;; Use (progn ...) as equivalent of comma, this is reasonable. (defun comma ([config] (when (is_list config)) @@ -426,7 +426,7 @@ (line (test-pat 'ok (complex_or_2 #(true #(a b c))))) (line (test-pat 'error (complex_or_2 #(blurf #(a b c))))) - + (line (test-pat 'error (complex_or_2 #(true)))) (line (test-pat 'error (complex_or_2 #(true no_tuple)))) (line (test-pat 'error (complex_or_2 #(true ())))) @@ -440,7 +440,7 @@ (line (test-pat 'ok (complex_or_3 #(true) #b(1 2 3 4)))) (line (test-pat 'error (complex_or_3 'blurf #(a b c)))) - + (line (test-pat 'error (complex_or_3 #(false) #b(1 2 3 4)))) (line (test-pat 'error (complex_or_3 () #b(1 2)))) (line (test-pat 'error (complex_or_3 #(true) 45))) @@ -584,7 +584,6 @@ 'exit)) (line (test-pat 'ok (relprod #(Set a b) #(Set a b))))) - 'ok)) (defun relprod @@ -876,7 +875,7 @@ ;; literal_type_tests_1(Config) -> ;; %% Generate an Erlang module with all different type of type tests. ;; ?line Tests = make_test([{T,L} || T <- type_tests(), L <- literals()] ++ -;; [{is_function,L1,L2} || +;; [{is_function,L1,L2} || ;; L1 <- literals(), L2 <- literals()]), ;; ?line Mod = literal_test, ;; ?line Func = {function, 0, test, 0, [{clause,0,[],[],Tests}]}, @@ -894,7 +893,7 @@ ;; ?line Mod:test(), ;; ?line true = code:delete(Mod), ;; ?line code:purge(Mod), - + ;; %% Test compile:form/2. Turn off all optimizations. ;; ?line {ok,Mod,Code2} = compile:forms(Form, [binary,report,time, ;; no_copt,no_postopt]), @@ -986,7 +985,7 @@ (=:= (: erlang element 1 r2) 'Set)) 'ok)))) (line (test-pat 'ok (funcall rel-prod-body #(Set a b) #(Set a b))))) - + ;; 'andalso'/'orelse' with calls known to fail already at compile time. ;; Used to crash the code generator. @@ -1030,7 +1029,7 @@ (=:= (element 1 t) 'klurf))) (* 3 (id (element 2 t)))) ([_] 'error)) - + (defun traverse_dcd ([config] (when (is_list config)) (let* ((l0 '(#(log_header dcd_log "1.0" a b c) @@ -1125,7 +1124,7 @@ (line (test-pat 'error (ludicrous_tuple_size #(a b c)))) (line (test-pat 'error (ludicrous_tuple_size '(a b c)))) - + ;; Compile case not relevant for LFE. 'ok)) diff --git a/test/visual/test_macro.lfe b/test/visual/test_macro.lfe index 005c8a49..eba6c62d 100644 --- a/test/visual/test_macro.lfe +++ b/test/visual/test_macro.lfe @@ -28,7 +28,7 @@ ([(('?= p g e) . b) . c] (case e (p g . b) (_ (c-ond . c)))) ([(t . b) . c] (if t (begin . b) (c-ond . c))) ([] 'false)) - + (defun aa (x y) (let& ((o (e x)) (p (e-1 y))) From d59e793b129dc5ca95b9dcb9bd48a01725755378 Mon Sep 17 00:00:00 2001 From: Robert Virding Date: Sat, 24 Jul 2010 03:28:45 +0200 Subject: [PATCH 4/4] Minor patches. --- README | 22 ++++++++++++---------- doc/user_guide.txt | 9 +++++---- examples/core-macros.lfe | 13 +++++++++++-- src/ChangeLog | 10 ++++++++++ src/lfe_comp.erl | 3 ++- src/lfe_macro.erl | 9 +++------ src/lfe_shell.erl | 10 ++++++---- 7 files changed, 49 insertions(+), 27 deletions(-) diff --git a/README b/README index f91ed072..6946e582 100644 --- a/README +++ b/README @@ -14,14 +14,16 @@ of the function. The .beam file in ebin is for R13B. I will try to make a better fix soon. Sorry about that. - --------------- +v0.6 +---- + +Added new example file with core macros implemented in LFE. Allow literal strings in binaries, both as plain values and as values with specs, so (binary "abc" ("åäö" utf-8)) is valid. In the second -case the spec is applied to each character. Works with lists as -well. Add big, little and native as synonyms to big-endian, -little-endian and native-endian. +case the spec is applied to each character. Works with lists as well. +Add big, little and native as synonyms to big-endian, little-endian +and native-endian. Now have working Makefile, Emakefile and .app file. @@ -76,11 +78,11 @@ Parameterized modules. Added (export all) attribute to module definition. -New records which allow giving default values as in vanilla -Erlang. Records are still compatible with vanilla Erlang but now more -pratical to use. NOTE this change is not backwards compatible as -syntax for (make- ...) and (match- ...) have changed. Also added -general multiple (set- ...) macro. +New records which allow giving default values as in vanilla Erlang. +Records are still compatible with vanilla Erlang but now more pratical +to use. NOTE this change is not backwards compatible as syntax for +(make- ...) and (match- ...) have changed. Also added general multiple +(set- ...) macro. (eval-when-compile ...) added as a top-level form which allows functions to be defined when compiling the forms. These are useful for diff --git a/doc/user_guide.txt b/doc/user_guide.txt index 79eba1df..cfca3b04 100644 --- a/doc/user_guide.txt +++ b/doc/user_guide.txt @@ -127,7 +127,7 @@ Older Scheme inspired macros (define (name arg ...) ...) (define name lambda|match-lambda) (define-syntax name - (syntax-rules (pat exp) ...) | (macro (pat body) ...)) + (syntax-rules (pat exp) ...)|(macro (pat body) ...)) (let-syntax ((name ...) ...) ...) @@ -267,7 +267,7 @@ A macro is function of one argument which is a called with a list of the arguments to the macro call. It can be either a lambda or a match-lambda. The basic forms for defining macros are: -(define-macro name lambda | match-lambda) +(define-macro name lambda|match-lambda) (let-macro ((name lambda|match-lambda) ...) @@ -291,6 +291,9 @@ example: The macro definitions in a macrolet obey the same rules as defmacro. +Yes, we have the backquote. It is implemented as a macro so it is +expanded at macro expansion time. + Local functions that are only available at compile time and can be called by macros are defined by: @@ -323,8 +326,6 @@ call and do not contain the macro name. So using them we would get: N.B. These are definitely NOT hygienic. -Yes we have backquote. - *CAVEAT* While it is perfectly legal to define a Core form as a macro these will silently be ignored by the compiler. diff --git a/examples/core-macros.lfe b/examples/core-macros.lfe index c38370f3..913878a1 100644 --- a/examples/core-macros.lfe +++ b/examples/core-macros.lfe @@ -31,6 +31,10 @@ ;; been implemented in LFE. They are implemented in lfe_macro.erl ;; today as there is yet no way to compile macros, and to ensure that ;; they are always available. These are shown mostly without comments. +;; +;; For some macros we give two versions, an all-in-one version and a +;; recursive more syntax pattern based expansion. This to show +;; different styles of doing the same thing. (defmacro caar (x) `(car (car ,x))) (defmacro cadr (x) `(car (cdr ,x))) @@ -52,15 +56,20 @@ ((e . es) `(cons ,e (list* . ,es))) (() ())) +;; (defmacro let* +;; ((vbs . b) +;; (: lists foldr +;; (lambda (vb rest) `(let (,vb) ,rest)) `(progn . ,b) vbs))) + (defmacro let* (((vb . vbs) . b) `(let (,vb) (let* ,vbs . ,b))) ((() . b) `(progn . ,b)) ((vb . b) `(let ,vb . b))) ;Pass error to let (defmacro flet* - (((vb . vbs) . b) `(flet (,vb) (flet* ,vbs . ,b))) + (((fb . fbs) . b) `(flet (,fb) (flet* ,fbs . ,b))) ((() . b) `(progn . ,b)) - ((vb . b) `(flet ,vb . b))) ;Pass error to flet + ((fb . b) `(flet ,fb . b))) ;Pass error to flet (defmacro cond ((('else . b)) `(progn . ,b)) diff --git a/src/ChangeLog b/src/ChangeLog index c84bb44d..3147e53b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2010-07-24 Robert Virding + + * lfe_shell.erl (macroexpand, macroexpand_1): Return evaluated + argument if no expansion. + +2010-07-12 Robert Virding + + * lfe_scan.xrl: Have separate cases for integer, float and symbol + atoms, catch errors better. + 2010-06-07 Robert Virding * lfe_lint.erl (pat_bitsegs): Allow strings (integer lists). diff --git a/src/lfe_comp.erl b/src/lfe_comp.erl index 5fe0308a..cfc26eec 100644 --- a/src/lfe_comp.erl +++ b/src/lfe_comp.erl @@ -221,7 +221,8 @@ do_passes([], St) -> {ok,St}. %Got to the end, everything ok! do_save_file(Fun, Ext, St) -> Name = filename:join(St#comp.odir, St#comp.base ++ ["."|Ext]), - case file:open(Name, [write,delayed_write]) of + %% delayed_write useful here but plays havoc with erjang. + case file:open(Name, [write]) of {ok,File} -> Fun(File, St#comp.code), ok = file:close(File), diff --git a/src/lfe_macro.erl b/src/lfe_macro.erl index f08dd19b..814ddd44 100644 --- a/src/lfe_macro.erl +++ b/src/lfe_macro.erl @@ -556,9 +556,6 @@ exp_macro([Mac|Args], Def0, Env, St0) -> erlang:error({expand_macro,Mac,Error}) end. -%% Exp = lfe_eval:apply(Def1, [Args], Env), -%% {Exp,St1}. - %% exp_predef(Form, Env, State) -> {yes,Form,State} | no. %% Handle the builtin predefined macros but only one at top-level and %% only once. Expand must be called on result to fully expand @@ -599,9 +596,9 @@ exp_predef(['let*'|Lbody], _, St) -> {yes,Exp,St}; exp_predef(['flet*'|Lbody], _, St) -> Exp = case Lbody of - [[Vb|Vbs]|B] -> ['flet',[Vb],['flet*',Vbs|B]]; + [[Fb|Fbs]|B] -> ['flet',[Fb],['flet*',Fbs|B]]; [[]|B] -> ['progn'|B]; - [Vb|B] -> ['flet',Vb|B] %Pass error to flet for lint. + [Fb|B] -> ['flet',Fb|B] %Pass error to flet for lint. end, {yes,Exp,St}; exp_predef(['cond'|Cbody], _, St) -> @@ -838,7 +835,7 @@ bq_expand([[unquote|X]|Y], 0) -> bq_append([list|X], bq_expand(Y, 0)); bq_expand([['unquote-splicing'|X]|Y], 0) -> bq_append(['++'|X], bq_expand(Y, 0)); -bq_expand([X|Y], N) -> +bq_expand([X|Y], N) -> %The general list case bq_cons(bq_expand(X, N), bq_expand(Y, N)); bq_expand(X, N) when is_tuple(X) -> %% Straight [list_to_tuple,bq_expand(tuple_to_list(X), N)] inefficient diff --git a/src/lfe_shell.erl b/src/lfe_shell.erl index c42b85cf..49c59b6e 100644 --- a/src/lfe_shell.erl +++ b/src/lfe_shell.erl @@ -205,15 +205,17 @@ m(Args, Eenv, _) -> %% We special case these at shell level so as to get shell environment. macroexpand(S, Eenv, _) -> - case lfe_macro:expand_macro(lfe_eval:expr(S, Eenv), Eenv) of + Arg = lfe_eval:expr(S, Eenv), + case lfe_macro:expand_macro(Arg, Eenv) of {yes,Exp} -> {yes,Exp,Eenv}; - no -> {yes,S,Eenv} + no -> {yes,Arg,Eenv} end. macroexpand_1(S, Eenv, _) -> - case lfe_macro:expand_macro_1(lfe_eval:expr(S, Eenv), Eenv) of + Arg = lfe_eval:expr(S, Eenv), + case lfe_macro:expand_macro_1(Arg, Eenv) of {yes,Exp} -> {yes,Exp,Eenv}; - no -> {yes,S,Eenv} + no -> {yes,Arg,Eenv} end. macroexpand_all(S, Eenv, _) ->