From 30a0682c036d07dd6ff5b92d5893a348cc7b777a Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Tue, 13 Nov 2018 23:42:11 +0000 Subject: [PATCH] Fixed a couple of lexer/parser errors in flex mode (-F option). This fixes bug #229: re2c option -F (flex syntax) broken, reported by Robert van Engelen. A well-formed example that caused syntax error (flex-style raw literal followed by one or more spaces and a curly brace): /*!re2c a {} */ The faulty behaviour goes back as far as re2c-0.13.6 (and supposedly before that): in flex mode, raw literal may occur in various contexts both as a regexp (string literal) and an identifier (named definition, condiiton name). RE2C uses lookahead to infer the context and determine the appropriate type of lexer token, but it missed some cases. The fix has two sides. First, if reduces the number of contexts where the general lexer may encounter raw literal (by using specialized lexers for condition lists and condition goto => and :=>). Second, it fixes the lookahead regexps used for context inference. Also added a bunch of tests (generated by a script). --- re2c/bootstrap/src/ast/lex.cc | 2537 ++++++++++------- re2c/bootstrap/src/ast/parser.cc | 235 +- re2c/bootstrap/src/ast/y.tab.h | 21 +- re2c/src/ast/lex.re | 103 +- re2c/src/ast/parser.ypp | 69 +- re2c/src/ast/scanner.h | 4 + re2c/test/cond_error_07.c.c | 2 +- re2c/test/cond_error_12.c.c | 2 +- re2c/test/flex_syntax/001a.i--flex-syntax.c | 17 + re2c/test/flex_syntax/001a.i--flex-syntax.re | 4 + re2c/test/flex_syntax/001b.i--flex-syntax.c | 17 + re2c/test/flex_syntax/001b.i--flex-syntax.re | 4 + re2c/test/flex_syntax/001c.i--flex-syntax.c | 17 + re2c/test/flex_syntax/001c.i--flex-syntax.re | 4 + re2c/test/flex_syntax/002a.i--flex-syntax.c | 24 + re2c/test/flex_syntax/002a.i--flex-syntax.re | 4 + re2c/test/flex_syntax/002b.i--flex-syntax.c | 24 + re2c/test/flex_syntax/002b.i--flex-syntax.re | 4 + re2c/test/flex_syntax/002c.i--flex-syntax.c | 24 + re2c/test/flex_syntax/002c.i--flex-syntax.re | 4 + re2c/test/flex_syntax/002d.i--flex-syntax.c | 24 + re2c/test/flex_syntax/002d.i--flex-syntax.re | 4 + re2c/test/flex_syntax/002e.i--flex-syntax.c | 24 + re2c/test/flex_syntax/002e.i--flex-syntax.re | 4 + re2c/test/flex_syntax/002f.i--flex-syntax.c | 24 + re2c/test/flex_syntax/002f.i--flex-syntax.re | 4 + re2c/test/flex_syntax/002g.i--flex-syntax.c | 24 + re2c/test/flex_syntax/002g.i--flex-syntax.re | 4 + re2c/test/flex_syntax/002h.i--flex-syntax.c | 24 + re2c/test/flex_syntax/002h.i--flex-syntax.re | 4 + re2c/test/flex_syntax/002i.i--flex-syntax.c | 24 + re2c/test/flex_syntax/002i.i--flex-syntax.re | 4 + re2c/test/flex_syntax/002j.i--flex-syntax.c | 24 + re2c/test/flex_syntax/002j.i--flex-syntax.re | 4 + re2c/test/flex_syntax/003a.i--flex-syntax.c | 18 + re2c/test/flex_syntax/003a.i--flex-syntax.re | 4 + re2c/test/flex_syntax/003b.i--flex-syntax.c | 18 + re2c/test/flex_syntax/003b.i--flex-syntax.re | 4 + re2c/test/flex_syntax/003c.i--flex-syntax.c | 18 + re2c/test/flex_syntax/003c.i--flex-syntax.re | 4 + re2c/test/flex_syntax/003d.i--flex-syntax.c | 18 + re2c/test/flex_syntax/003d.i--flex-syntax.re | 4 + re2c/test/flex_syntax/003e.i--flex-syntax.c | 18 + re2c/test/flex_syntax/003e.i--flex-syntax.re | 4 + re2c/test/flex_syntax/003f.i--flex-syntax.c | 18 + re2c/test/flex_syntax/003f.i--flex-syntax.re | 4 + re2c/test/flex_syntax/004a.i--flex-syntax.c | 25 + re2c/test/flex_syntax/004a.i--flex-syntax.re | 4 + re2c/test/flex_syntax/004b.i--flex-syntax.c | 25 + re2c/test/flex_syntax/004b.i--flex-syntax.re | 4 + re2c/test/flex_syntax/004c.i--flex-syntax.c | 25 + re2c/test/flex_syntax/004c.i--flex-syntax.re | 4 + re2c/test/flex_syntax/004d.i--flex-syntax.c | 25 + re2c/test/flex_syntax/004d.i--flex-syntax.re | 4 + re2c/test/flex_syntax/005a.i--flex-syntax.c | 25 + re2c/test/flex_syntax/005a.i--flex-syntax.re | 4 + re2c/test/flex_syntax/005b.i--flex-syntax.c | 25 + re2c/test/flex_syntax/005b.i--flex-syntax.re | 4 + re2c/test/flex_syntax/005c.i--flex-syntax.c | 25 + re2c/test/flex_syntax/005c.i--flex-syntax.re | 4 + re2c/test/flex_syntax/005d.i--flex-syntax.c | 25 + re2c/test/flex_syntax/005d.i--flex-syntax.re | 4 + re2c/test/flex_syntax/005e.i--flex-syntax.c | 25 + re2c/test/flex_syntax/005e.i--flex-syntax.re | 4 + re2c/test/flex_syntax/005f.i--flex-syntax.c | 25 + re2c/test/flex_syntax/005f.i--flex-syntax.re | 4 + re2c/test/flex_syntax/005g.i--flex-syntax.c | 25 + re2c/test/flex_syntax/005g.i--flex-syntax.re | 4 + re2c/test/flex_syntax/006a.i--flex-syntax.c | 25 + re2c/test/flex_syntax/006a.i--flex-syntax.re | 4 + re2c/test/flex_syntax/006b.i--flex-syntax.c | 25 + re2c/test/flex_syntax/006b.i--flex-syntax.re | 4 + re2c/test/flex_syntax/006c.i--flex-syntax.c | 25 + re2c/test/flex_syntax/006c.i--flex-syntax.re | 4 + re2c/test/flex_syntax/006d.i--flex-syntax.c | 25 + re2c/test/flex_syntax/006d.i--flex-syntax.re | 4 + re2c/test/flex_syntax/006e.i--flex-syntax.c | 25 + re2c/test/flex_syntax/006e.i--flex-syntax.re | 4 + re2c/test/flex_syntax/006f.i--flex-syntax.c | 25 + re2c/test/flex_syntax/006f.i--flex-syntax.re | 4 + re2c/test/flex_syntax/006g.i--flex-syntax.c | 25 + re2c/test/flex_syntax/006g.i--flex-syntax.re | 4 + re2c/test/flex_syntax/__patterns | 43 + re2c/test/flex_syntax/__run.sh | 36 + re2c/test/layout/000.i.c | 51 + re2c/test/layout/000.i.re | 12 + re2c/test/layout/000_1.i.c | 51 + re2c/test/layout/000_1.i.re | 12 + re2c/test/layout/000_2.ci.c | 193 ++ re2c/test/layout/000_2.ci.re | 16 + re2c/test/layout/001_01.i--flex-syntax.c | 18 + re2c/test/layout/001_01.i--flex-syntax.re | 5 + re2c/test/layout/001_02.i--flex-syntax.c | 18 + re2c/test/layout/001_02.i--flex-syntax.re | 5 + re2c/test/layout/001_03.i--flex-syntax.c | 18 + re2c/test/layout/001_03.i--flex-syntax.re | 7 + re2c/test/layout/001_04.i--flex-syntax.c | 17 + re2c/test/layout/001_04.i--flex-syntax.re | 4 + re2c/test/layout/001_05.i--flex-syntax.c | 17 + re2c/test/layout/001_05.i--flex-syntax.re | 4 + re2c/test/layout/001_06.i--flex-syntax.c | 19 + re2c/test/layout/001_06.i--flex-syntax.re | 6 + re2c/test/layout/001_07.ci--flex-syntax.c | 28 + re2c/test/layout/001_07.ci--flex-syntax.re | 4 + re2c/test/layout/001_08.ci--flex-syntax.c | 28 + re2c/test/layout/001_08.ci--flex-syntax.re | 4 + re2c/test/layout/001_09.ci--flex-syntax.c | 30 + re2c/test/layout/001_09.ci--flex-syntax.re | 4 + re2c/test/layout/001_10.ci--flex-syntax.c | 30 + re2c/test/layout/001_10.ci--flex-syntax.re | 4 + re2c/test/layout/002_01.i.c | 18 + re2c/test/layout/002_01.i.re | 5 + re2c/test/layout/002_02.i.c | 18 + re2c/test/layout/002_02.i.re | 5 + re2c/test/layout/002_03.i.c | 18 + re2c/test/layout/002_03.i.re | 7 + re2c/test/layout/002_04.i.c | 17 + re2c/test/layout/002_04.i.re | 4 + re2c/test/layout/002_05.i.c | 17 + re2c/test/layout/002_05.i.re | 4 + re2c/test/layout/002_06.i.c | 19 + re2c/test/layout/002_06.i.re | 6 + re2c/test/layout/002_07.ci.c | 28 + re2c/test/layout/002_07.ci.re | 4 + re2c/test/layout/002_08.ci.c | 28 + re2c/test/layout/002_08.ci.re | 4 + re2c/test/layout/002_09.ci.c | 30 + re2c/test/layout/002_09.ci.re | 4 + re2c/test/layout/002_10.ci.c | 30 + re2c/test/layout/002_10.ci.re | 4 + re2c/test/layout/003_01.i.c | 18 + re2c/test/layout/003_01.i.re | 5 + re2c/test/layout/003_02.i.c | 18 + re2c/test/layout/003_02.i.re | 5 + re2c/test/layout/003_03.i.c | 18 + re2c/test/layout/003_03.i.re | 7 + re2c/test/layout/003_04.i.c | 17 + re2c/test/layout/003_04.i.re | 4 + re2c/test/layout/003_05.i.c | 17 + re2c/test/layout/003_05.i.re | 4 + re2c/test/layout/003_06.i.c | 19 + re2c/test/layout/003_06.i.re | 6 + re2c/test/layout/003_07.ci.c | 28 + re2c/test/layout/003_07.ci.re | 4 + re2c/test/layout/003_08.ci.c | 28 + re2c/test/layout/003_08.ci.re | 4 + re2c/test/layout/003_09.ci.c | 30 + re2c/test/layout/003_09.ci.re | 4 + re2c/test/layout/003_10.ci.c | 30 + re2c/test/layout/003_10.ci.re | 4 + re2c/test/layout/004_01.i--posix-captures.c | 23 + re2c/test/layout/004_01.i--posix-captures.re | 5 + re2c/test/layout/004_02.i--posix-captures.c | 23 + re2c/test/layout/004_02.i--posix-captures.re | 5 + re2c/test/layout/004_03.i--posix-captures.c | 23 + re2c/test/layout/004_03.i--posix-captures.re | 7 + re2c/test/layout/004_04.i--posix-captures.c | 22 + re2c/test/layout/004_04.i--posix-captures.re | 4 + re2c/test/layout/004_05.i--posix-captures.c | 22 + re2c/test/layout/004_05.i--posix-captures.re | 4 + re2c/test/layout/004_06.i--posix-captures.c | 24 + re2c/test/layout/004_06.i--posix-captures.re | 6 + re2c/test/layout/004_07.ci--posix-captures.c | 33 + re2c/test/layout/004_07.ci--posix-captures.re | 4 + re2c/test/layout/004_08.ci--posix-captures.c | 33 + re2c/test/layout/004_08.ci--posix-captures.re | 4 + re2c/test/layout/004_09.ci--posix-captures.c | 35 + re2c/test/layout/004_09.ci--posix-captures.re | 4 + re2c/test/layout/004_10.ci--posix-captures.c | 35 + re2c/test/layout/004_10.ci--posix-captures.re | 4 + re2c/test/layout/005_01.i.c | 18 + re2c/test/layout/005_01.i.re | 5 + re2c/test/layout/005_02.i.c | 18 + re2c/test/layout/005_02.i.re | 5 + re2c/test/layout/005_03.i.c | 18 + re2c/test/layout/005_03.i.re | 7 + re2c/test/layout/005_04.i.c | 17 + re2c/test/layout/005_04.i.re | 4 + re2c/test/layout/005_05.i.c | 17 + re2c/test/layout/005_05.i.re | 4 + re2c/test/layout/005_06.i.c | 19 + re2c/test/layout/005_06.i.re | 6 + re2c/test/layout/005_07.ci.c | 28 + re2c/test/layout/005_07.ci.re | 4 + re2c/test/layout/005_08.ci.c | 28 + re2c/test/layout/005_08.ci.re | 4 + re2c/test/layout/005_09.ci.c | 30 + re2c/test/layout/005_09.ci.re | 4 + re2c/test/layout/005_10.ci.c | 30 + re2c/test/layout/005_10.ci.re | 4 + re2c/test/layout/006_01.i.c | 19 + re2c/test/layout/006_01.i.re | 5 + re2c/test/layout/006_02.i.c | 19 + re2c/test/layout/006_02.i.re | 5 + re2c/test/layout/006_03.i.c | 19 + re2c/test/layout/006_03.i.re | 7 + re2c/test/layout/006_04.i.c | 18 + re2c/test/layout/006_04.i.re | 4 + re2c/test/layout/006_05.i.c | 18 + re2c/test/layout/006_05.i.re | 4 + re2c/test/layout/006_06.i.c | 20 + re2c/test/layout/006_06.i.re | 6 + re2c/test/layout/006_07.ci.c | 29 + re2c/test/layout/006_07.ci.re | 4 + re2c/test/layout/006_08.ci.c | 29 + re2c/test/layout/006_08.ci.re | 4 + re2c/test/layout/006_09.ci.c | 31 + re2c/test/layout/006_09.ci.re | 4 + re2c/test/layout/006_10.ci.c | 31 + re2c/test/layout/006_10.ci.re | 4 + re2c/test/layout/007_01.i.c | 26 + re2c/test/layout/007_01.i.re | 5 + re2c/test/layout/007_02.i.c | 26 + re2c/test/layout/007_02.i.re | 5 + re2c/test/layout/007_03.i.c | 26 + re2c/test/layout/007_03.i.re | 7 + re2c/test/layout/007_04.i.c | 19 + re2c/test/layout/007_04.i.re | 4 + re2c/test/layout/007_05.i.c | 25 + re2c/test/layout/007_05.i.re | 4 + re2c/test/layout/007_06.i.c | 27 + re2c/test/layout/007_06.i.re | 6 + re2c/test/layout/007_07.ci.c | 36 + re2c/test/layout/007_07.ci.re | 4 + re2c/test/layout/007_08.ci.c | 36 + re2c/test/layout/007_08.ci.re | 4 + re2c/test/layout/007_09.ci.c | 38 + re2c/test/layout/007_09.ci.re | 4 + re2c/test/layout/007_10.ci.c | 38 + re2c/test/layout/007_10.ci.re | 4 + re2c/test/layout/008_01.i.c | 25 + re2c/test/layout/008_01.i.re | 5 + re2c/test/layout/008_02.i.c | 25 + re2c/test/layout/008_02.i.re | 5 + re2c/test/layout/008_03.i.c | 25 + re2c/test/layout/008_03.i.re | 7 + re2c/test/layout/008_04.i.c | 24 + re2c/test/layout/008_04.i.re | 4 + re2c/test/layout/008_05.i.c | 24 + re2c/test/layout/008_05.i.re | 4 + re2c/test/layout/008_06.i.c | 26 + re2c/test/layout/008_06.i.re | 6 + re2c/test/layout/008_07.ci.c | 35 + re2c/test/layout/008_07.ci.re | 4 + re2c/test/layout/008_08.ci.c | 35 + re2c/test/layout/008_08.ci.re | 4 + re2c/test/layout/008_09.ci.c | 37 + re2c/test/layout/008_09.ci.re | 4 + re2c/test/layout/008_10.ci.c | 37 + re2c/test/layout/008_10.ci.re | 4 + re2c/test/layout/009_01.i.c | 18 + re2c/test/layout/009_01.i.re | 5 + re2c/test/layout/009_02.i.c | 18 + re2c/test/layout/009_02.i.re | 5 + re2c/test/layout/009_03.i.c | 18 + re2c/test/layout/009_03.i.re | 7 + re2c/test/layout/009_04.i.c | 17 + re2c/test/layout/009_04.i.re | 4 + re2c/test/layout/009_05.i.c | 17 + re2c/test/layout/009_05.i.re | 4 + re2c/test/layout/009_06.i.c | 19 + re2c/test/layout/009_06.i.re | 6 + re2c/test/layout/009_07.ci.c | 28 + re2c/test/layout/009_07.ci.re | 4 + re2c/test/layout/009_08.ci.c | 28 + re2c/test/layout/009_08.ci.re | 4 + re2c/test/layout/009_09.ci.c | 30 + re2c/test/layout/009_09.ci.re | 4 + re2c/test/layout/009_10.ci.c | 30 + re2c/test/layout/009_10.ci.re | 4 + re2c/test/layout/010_01.i.c | 25 + re2c/test/layout/010_01.i.re | 5 + re2c/test/layout/010_02.i.c | 25 + re2c/test/layout/010_02.i.re | 5 + re2c/test/layout/010_03.i.c | 25 + re2c/test/layout/010_03.i.re | 7 + re2c/test/layout/010_04.i.c | 24 + re2c/test/layout/010_04.i.re | 4 + re2c/test/layout/010_05.i.c | 24 + re2c/test/layout/010_05.i.re | 4 + re2c/test/layout/010_06.i.c | 26 + re2c/test/layout/010_06.i.re | 6 + re2c/test/layout/010_07.ci.c | 35 + re2c/test/layout/010_07.ci.re | 4 + re2c/test/layout/010_08.ci.c | 35 + re2c/test/layout/010_08.ci.re | 4 + re2c/test/layout/010_09.ci.c | 37 + re2c/test/layout/010_09.ci.re | 4 + re2c/test/layout/010_10.ci.c | 37 + re2c/test/layout/010_10.ci.re | 4 + re2c/test/layout/011_01.i.c | 26 + re2c/test/layout/011_01.i.re | 5 + re2c/test/layout/011_02.i.c | 26 + re2c/test/layout/011_02.i.re | 5 + re2c/test/layout/011_03.i.c | 26 + re2c/test/layout/011_03.i.re | 7 + re2c/test/layout/011_04.i.c | 25 + re2c/test/layout/011_04.i.re | 4 + re2c/test/layout/011_05.i.c | 25 + re2c/test/layout/011_05.i.re | 4 + re2c/test/layout/011_06.i.c | 27 + re2c/test/layout/011_06.i.re | 6 + re2c/test/layout/011_07.ci.c | 36 + re2c/test/layout/011_07.ci.re | 4 + re2c/test/layout/011_08.ci.c | 36 + re2c/test/layout/011_08.ci.re | 4 + re2c/test/layout/011_09.ci.c | 38 + re2c/test/layout/011_09.ci.re | 4 + re2c/test/layout/011_10.ci.c | 38 + re2c/test/layout/011_10.ci.re | 4 + re2c/test/layout/012_01.i--tags.c | 20 + re2c/test/layout/012_01.i--tags.re | 5 + re2c/test/layout/012_02.i--tags.c | 20 + re2c/test/layout/012_02.i--tags.re | 5 + re2c/test/layout/012_03.i--tags.c | 20 + re2c/test/layout/012_03.i--tags.re | 7 + re2c/test/layout/012_04.i--tags.c | 19 + re2c/test/layout/012_04.i--tags.re | 4 + re2c/test/layout/012_05.i--tags.c | 19 + re2c/test/layout/012_05.i--tags.re | 4 + re2c/test/layout/012_06.i--tags.c | 21 + re2c/test/layout/012_06.i--tags.re | 6 + re2c/test/layout/012_07.ci--tags.c | 30 + re2c/test/layout/012_07.ci--tags.re | 4 + re2c/test/layout/012_08.ci--tags.c | 30 + re2c/test/layout/012_08.ci--tags.re | 4 + re2c/test/layout/012_09.ci--tags.c | 32 + re2c/test/layout/012_09.ci--tags.re | 4 + re2c/test/layout/012_10.ci--tags.c | 32 + re2c/test/layout/012_10.ci--tags.re | 4 + re2c/test/layout/013_01.i--tags.c | 23 + re2c/test/layout/013_01.i--tags.re | 5 + re2c/test/layout/013_02.i--tags.c | 23 + re2c/test/layout/013_02.i--tags.re | 5 + re2c/test/layout/013_03.i--tags.c | 23 + re2c/test/layout/013_03.i--tags.re | 7 + re2c/test/layout/013_04.i--tags.c | 22 + re2c/test/layout/013_04.i--tags.re | 4 + re2c/test/layout/013_05.i--tags.c | 22 + re2c/test/layout/013_05.i--tags.re | 4 + re2c/test/layout/013_06.i--tags.c | 24 + re2c/test/layout/013_06.i--tags.re | 6 + re2c/test/layout/013_07.ci--tags.c | 33 + re2c/test/layout/013_07.ci--tags.re | 4 + re2c/test/layout/013_08.ci--tags.c | 33 + re2c/test/layout/013_08.ci--tags.re | 4 + re2c/test/layout/013_09.ci--tags.c | 35 + re2c/test/layout/013_09.ci--tags.re | 4 + re2c/test/layout/013_10.ci--tags.c | 35 + re2c/test/layout/013_10.ci--tags.re | 4 + re2c/test/layout/__patterns | 13 + re2c/test/layout/__run.sh | 84 + re2c/test/posix_captures/.run/__run.sh | 5 +- 353 files changed, 7243 insertions(+), 1177 deletions(-) create mode 100644 re2c/test/flex_syntax/001a.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/001a.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/001b.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/001b.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/001c.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/001c.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/002a.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/002a.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/002b.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/002b.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/002c.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/002c.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/002d.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/002d.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/002e.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/002e.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/002f.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/002f.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/002g.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/002g.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/002h.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/002h.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/002i.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/002i.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/002j.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/002j.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/003a.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/003a.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/003b.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/003b.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/003c.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/003c.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/003d.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/003d.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/003e.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/003e.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/003f.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/003f.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/004a.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/004a.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/004b.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/004b.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/004c.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/004c.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/004d.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/004d.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/005a.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/005a.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/005b.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/005b.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/005c.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/005c.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/005d.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/005d.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/005e.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/005e.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/005f.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/005f.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/005g.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/005g.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/006a.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/006a.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/006b.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/006b.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/006c.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/006c.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/006d.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/006d.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/006e.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/006e.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/006f.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/006f.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/006g.i--flex-syntax.c create mode 100644 re2c/test/flex_syntax/006g.i--flex-syntax.re create mode 100644 re2c/test/flex_syntax/__patterns create mode 100755 re2c/test/flex_syntax/__run.sh create mode 100644 re2c/test/layout/000.i.c create mode 100644 re2c/test/layout/000.i.re create mode 100644 re2c/test/layout/000_1.i.c create mode 100644 re2c/test/layout/000_1.i.re create mode 100644 re2c/test/layout/000_2.ci.c create mode 100644 re2c/test/layout/000_2.ci.re create mode 100644 re2c/test/layout/001_01.i--flex-syntax.c create mode 100644 re2c/test/layout/001_01.i--flex-syntax.re create mode 100644 re2c/test/layout/001_02.i--flex-syntax.c create mode 100644 re2c/test/layout/001_02.i--flex-syntax.re create mode 100644 re2c/test/layout/001_03.i--flex-syntax.c create mode 100644 re2c/test/layout/001_03.i--flex-syntax.re create mode 100644 re2c/test/layout/001_04.i--flex-syntax.c create mode 100644 re2c/test/layout/001_04.i--flex-syntax.re create mode 100644 re2c/test/layout/001_05.i--flex-syntax.c create mode 100644 re2c/test/layout/001_05.i--flex-syntax.re create mode 100644 re2c/test/layout/001_06.i--flex-syntax.c create mode 100644 re2c/test/layout/001_06.i--flex-syntax.re create mode 100644 re2c/test/layout/001_07.ci--flex-syntax.c create mode 100644 re2c/test/layout/001_07.ci--flex-syntax.re create mode 100644 re2c/test/layout/001_08.ci--flex-syntax.c create mode 100644 re2c/test/layout/001_08.ci--flex-syntax.re create mode 100644 re2c/test/layout/001_09.ci--flex-syntax.c create mode 100644 re2c/test/layout/001_09.ci--flex-syntax.re create mode 100644 re2c/test/layout/001_10.ci--flex-syntax.c create mode 100644 re2c/test/layout/001_10.ci--flex-syntax.re create mode 100644 re2c/test/layout/002_01.i.c create mode 100644 re2c/test/layout/002_01.i.re create mode 100644 re2c/test/layout/002_02.i.c create mode 100644 re2c/test/layout/002_02.i.re create mode 100644 re2c/test/layout/002_03.i.c create mode 100644 re2c/test/layout/002_03.i.re create mode 100644 re2c/test/layout/002_04.i.c create mode 100644 re2c/test/layout/002_04.i.re create mode 100644 re2c/test/layout/002_05.i.c create mode 100644 re2c/test/layout/002_05.i.re create mode 100644 re2c/test/layout/002_06.i.c create mode 100644 re2c/test/layout/002_06.i.re create mode 100644 re2c/test/layout/002_07.ci.c create mode 100644 re2c/test/layout/002_07.ci.re create mode 100644 re2c/test/layout/002_08.ci.c create mode 100644 re2c/test/layout/002_08.ci.re create mode 100644 re2c/test/layout/002_09.ci.c create mode 100644 re2c/test/layout/002_09.ci.re create mode 100644 re2c/test/layout/002_10.ci.c create mode 100644 re2c/test/layout/002_10.ci.re create mode 100644 re2c/test/layout/003_01.i.c create mode 100644 re2c/test/layout/003_01.i.re create mode 100644 re2c/test/layout/003_02.i.c create mode 100644 re2c/test/layout/003_02.i.re create mode 100644 re2c/test/layout/003_03.i.c create mode 100644 re2c/test/layout/003_03.i.re create mode 100644 re2c/test/layout/003_04.i.c create mode 100644 re2c/test/layout/003_04.i.re create mode 100644 re2c/test/layout/003_05.i.c create mode 100644 re2c/test/layout/003_05.i.re create mode 100644 re2c/test/layout/003_06.i.c create mode 100644 re2c/test/layout/003_06.i.re create mode 100644 re2c/test/layout/003_07.ci.c create mode 100644 re2c/test/layout/003_07.ci.re create mode 100644 re2c/test/layout/003_08.ci.c create mode 100644 re2c/test/layout/003_08.ci.re create mode 100644 re2c/test/layout/003_09.ci.c create mode 100644 re2c/test/layout/003_09.ci.re create mode 100644 re2c/test/layout/003_10.ci.c create mode 100644 re2c/test/layout/003_10.ci.re create mode 100644 re2c/test/layout/004_01.i--posix-captures.c create mode 100644 re2c/test/layout/004_01.i--posix-captures.re create mode 100644 re2c/test/layout/004_02.i--posix-captures.c create mode 100644 re2c/test/layout/004_02.i--posix-captures.re create mode 100644 re2c/test/layout/004_03.i--posix-captures.c create mode 100644 re2c/test/layout/004_03.i--posix-captures.re create mode 100644 re2c/test/layout/004_04.i--posix-captures.c create mode 100644 re2c/test/layout/004_04.i--posix-captures.re create mode 100644 re2c/test/layout/004_05.i--posix-captures.c create mode 100644 re2c/test/layout/004_05.i--posix-captures.re create mode 100644 re2c/test/layout/004_06.i--posix-captures.c create mode 100644 re2c/test/layout/004_06.i--posix-captures.re create mode 100644 re2c/test/layout/004_07.ci--posix-captures.c create mode 100644 re2c/test/layout/004_07.ci--posix-captures.re create mode 100644 re2c/test/layout/004_08.ci--posix-captures.c create mode 100644 re2c/test/layout/004_08.ci--posix-captures.re create mode 100644 re2c/test/layout/004_09.ci--posix-captures.c create mode 100644 re2c/test/layout/004_09.ci--posix-captures.re create mode 100644 re2c/test/layout/004_10.ci--posix-captures.c create mode 100644 re2c/test/layout/004_10.ci--posix-captures.re create mode 100644 re2c/test/layout/005_01.i.c create mode 100644 re2c/test/layout/005_01.i.re create mode 100644 re2c/test/layout/005_02.i.c create mode 100644 re2c/test/layout/005_02.i.re create mode 100644 re2c/test/layout/005_03.i.c create mode 100644 re2c/test/layout/005_03.i.re create mode 100644 re2c/test/layout/005_04.i.c create mode 100644 re2c/test/layout/005_04.i.re create mode 100644 re2c/test/layout/005_05.i.c create mode 100644 re2c/test/layout/005_05.i.re create mode 100644 re2c/test/layout/005_06.i.c create mode 100644 re2c/test/layout/005_06.i.re create mode 100644 re2c/test/layout/005_07.ci.c create mode 100644 re2c/test/layout/005_07.ci.re create mode 100644 re2c/test/layout/005_08.ci.c create mode 100644 re2c/test/layout/005_08.ci.re create mode 100644 re2c/test/layout/005_09.ci.c create mode 100644 re2c/test/layout/005_09.ci.re create mode 100644 re2c/test/layout/005_10.ci.c create mode 100644 re2c/test/layout/005_10.ci.re create mode 100644 re2c/test/layout/006_01.i.c create mode 100644 re2c/test/layout/006_01.i.re create mode 100644 re2c/test/layout/006_02.i.c create mode 100644 re2c/test/layout/006_02.i.re create mode 100644 re2c/test/layout/006_03.i.c create mode 100644 re2c/test/layout/006_03.i.re create mode 100644 re2c/test/layout/006_04.i.c create mode 100644 re2c/test/layout/006_04.i.re create mode 100644 re2c/test/layout/006_05.i.c create mode 100644 re2c/test/layout/006_05.i.re create mode 100644 re2c/test/layout/006_06.i.c create mode 100644 re2c/test/layout/006_06.i.re create mode 100644 re2c/test/layout/006_07.ci.c create mode 100644 re2c/test/layout/006_07.ci.re create mode 100644 re2c/test/layout/006_08.ci.c create mode 100644 re2c/test/layout/006_08.ci.re create mode 100644 re2c/test/layout/006_09.ci.c create mode 100644 re2c/test/layout/006_09.ci.re create mode 100644 re2c/test/layout/006_10.ci.c create mode 100644 re2c/test/layout/006_10.ci.re create mode 100644 re2c/test/layout/007_01.i.c create mode 100644 re2c/test/layout/007_01.i.re create mode 100644 re2c/test/layout/007_02.i.c create mode 100644 re2c/test/layout/007_02.i.re create mode 100644 re2c/test/layout/007_03.i.c create mode 100644 re2c/test/layout/007_03.i.re create mode 100644 re2c/test/layout/007_04.i.c create mode 100644 re2c/test/layout/007_04.i.re create mode 100644 re2c/test/layout/007_05.i.c create mode 100644 re2c/test/layout/007_05.i.re create mode 100644 re2c/test/layout/007_06.i.c create mode 100644 re2c/test/layout/007_06.i.re create mode 100644 re2c/test/layout/007_07.ci.c create mode 100644 re2c/test/layout/007_07.ci.re create mode 100644 re2c/test/layout/007_08.ci.c create mode 100644 re2c/test/layout/007_08.ci.re create mode 100644 re2c/test/layout/007_09.ci.c create mode 100644 re2c/test/layout/007_09.ci.re create mode 100644 re2c/test/layout/007_10.ci.c create mode 100644 re2c/test/layout/007_10.ci.re create mode 100644 re2c/test/layout/008_01.i.c create mode 100644 re2c/test/layout/008_01.i.re create mode 100644 re2c/test/layout/008_02.i.c create mode 100644 re2c/test/layout/008_02.i.re create mode 100644 re2c/test/layout/008_03.i.c create mode 100644 re2c/test/layout/008_03.i.re create mode 100644 re2c/test/layout/008_04.i.c create mode 100644 re2c/test/layout/008_04.i.re create mode 100644 re2c/test/layout/008_05.i.c create mode 100644 re2c/test/layout/008_05.i.re create mode 100644 re2c/test/layout/008_06.i.c create mode 100644 re2c/test/layout/008_06.i.re create mode 100644 re2c/test/layout/008_07.ci.c create mode 100644 re2c/test/layout/008_07.ci.re create mode 100644 re2c/test/layout/008_08.ci.c create mode 100644 re2c/test/layout/008_08.ci.re create mode 100644 re2c/test/layout/008_09.ci.c create mode 100644 re2c/test/layout/008_09.ci.re create mode 100644 re2c/test/layout/008_10.ci.c create mode 100644 re2c/test/layout/008_10.ci.re create mode 100644 re2c/test/layout/009_01.i.c create mode 100644 re2c/test/layout/009_01.i.re create mode 100644 re2c/test/layout/009_02.i.c create mode 100644 re2c/test/layout/009_02.i.re create mode 100644 re2c/test/layout/009_03.i.c create mode 100644 re2c/test/layout/009_03.i.re create mode 100644 re2c/test/layout/009_04.i.c create mode 100644 re2c/test/layout/009_04.i.re create mode 100644 re2c/test/layout/009_05.i.c create mode 100644 re2c/test/layout/009_05.i.re create mode 100644 re2c/test/layout/009_06.i.c create mode 100644 re2c/test/layout/009_06.i.re create mode 100644 re2c/test/layout/009_07.ci.c create mode 100644 re2c/test/layout/009_07.ci.re create mode 100644 re2c/test/layout/009_08.ci.c create mode 100644 re2c/test/layout/009_08.ci.re create mode 100644 re2c/test/layout/009_09.ci.c create mode 100644 re2c/test/layout/009_09.ci.re create mode 100644 re2c/test/layout/009_10.ci.c create mode 100644 re2c/test/layout/009_10.ci.re create mode 100644 re2c/test/layout/010_01.i.c create mode 100644 re2c/test/layout/010_01.i.re create mode 100644 re2c/test/layout/010_02.i.c create mode 100644 re2c/test/layout/010_02.i.re create mode 100644 re2c/test/layout/010_03.i.c create mode 100644 re2c/test/layout/010_03.i.re create mode 100644 re2c/test/layout/010_04.i.c create mode 100644 re2c/test/layout/010_04.i.re create mode 100644 re2c/test/layout/010_05.i.c create mode 100644 re2c/test/layout/010_05.i.re create mode 100644 re2c/test/layout/010_06.i.c create mode 100644 re2c/test/layout/010_06.i.re create mode 100644 re2c/test/layout/010_07.ci.c create mode 100644 re2c/test/layout/010_07.ci.re create mode 100644 re2c/test/layout/010_08.ci.c create mode 100644 re2c/test/layout/010_08.ci.re create mode 100644 re2c/test/layout/010_09.ci.c create mode 100644 re2c/test/layout/010_09.ci.re create mode 100644 re2c/test/layout/010_10.ci.c create mode 100644 re2c/test/layout/010_10.ci.re create mode 100644 re2c/test/layout/011_01.i.c create mode 100644 re2c/test/layout/011_01.i.re create mode 100644 re2c/test/layout/011_02.i.c create mode 100644 re2c/test/layout/011_02.i.re create mode 100644 re2c/test/layout/011_03.i.c create mode 100644 re2c/test/layout/011_03.i.re create mode 100644 re2c/test/layout/011_04.i.c create mode 100644 re2c/test/layout/011_04.i.re create mode 100644 re2c/test/layout/011_05.i.c create mode 100644 re2c/test/layout/011_05.i.re create mode 100644 re2c/test/layout/011_06.i.c create mode 100644 re2c/test/layout/011_06.i.re create mode 100644 re2c/test/layout/011_07.ci.c create mode 100644 re2c/test/layout/011_07.ci.re create mode 100644 re2c/test/layout/011_08.ci.c create mode 100644 re2c/test/layout/011_08.ci.re create mode 100644 re2c/test/layout/011_09.ci.c create mode 100644 re2c/test/layout/011_09.ci.re create mode 100644 re2c/test/layout/011_10.ci.c create mode 100644 re2c/test/layout/011_10.ci.re create mode 100644 re2c/test/layout/012_01.i--tags.c create mode 100644 re2c/test/layout/012_01.i--tags.re create mode 100644 re2c/test/layout/012_02.i--tags.c create mode 100644 re2c/test/layout/012_02.i--tags.re create mode 100644 re2c/test/layout/012_03.i--tags.c create mode 100644 re2c/test/layout/012_03.i--tags.re create mode 100644 re2c/test/layout/012_04.i--tags.c create mode 100644 re2c/test/layout/012_04.i--tags.re create mode 100644 re2c/test/layout/012_05.i--tags.c create mode 100644 re2c/test/layout/012_05.i--tags.re create mode 100644 re2c/test/layout/012_06.i--tags.c create mode 100644 re2c/test/layout/012_06.i--tags.re create mode 100644 re2c/test/layout/012_07.ci--tags.c create mode 100644 re2c/test/layout/012_07.ci--tags.re create mode 100644 re2c/test/layout/012_08.ci--tags.c create mode 100644 re2c/test/layout/012_08.ci--tags.re create mode 100644 re2c/test/layout/012_09.ci--tags.c create mode 100644 re2c/test/layout/012_09.ci--tags.re create mode 100644 re2c/test/layout/012_10.ci--tags.c create mode 100644 re2c/test/layout/012_10.ci--tags.re create mode 100644 re2c/test/layout/013_01.i--tags.c create mode 100644 re2c/test/layout/013_01.i--tags.re create mode 100644 re2c/test/layout/013_02.i--tags.c create mode 100644 re2c/test/layout/013_02.i--tags.re create mode 100644 re2c/test/layout/013_03.i--tags.c create mode 100644 re2c/test/layout/013_03.i--tags.re create mode 100644 re2c/test/layout/013_04.i--tags.c create mode 100644 re2c/test/layout/013_04.i--tags.re create mode 100644 re2c/test/layout/013_05.i--tags.c create mode 100644 re2c/test/layout/013_05.i--tags.re create mode 100644 re2c/test/layout/013_06.i--tags.c create mode 100644 re2c/test/layout/013_06.i--tags.re create mode 100644 re2c/test/layout/013_07.ci--tags.c create mode 100644 re2c/test/layout/013_07.ci--tags.re create mode 100644 re2c/test/layout/013_08.ci--tags.c create mode 100644 re2c/test/layout/013_08.ci--tags.re create mode 100644 re2c/test/layout/013_09.ci--tags.c create mode 100644 re2c/test/layout/013_09.ci--tags.re create mode 100644 re2c/test/layout/013_10.ci--tags.c create mode 100644 re2c/test/layout/013_10.ci--tags.re create mode 100644 re2c/test/layout/__patterns create mode 100755 re2c/test/layout/__run.sh diff --git a/re2c/bootstrap/src/ast/lex.cc b/re2c/bootstrap/src/ast/lex.cc index e2ba927a..e40c42e7 100644 --- a/re2c/bootstrap/src/ast/lex.cc +++ b/re2c/bootstrap/src/ast/lex.cc @@ -1,4 +1,4 @@ -/* Generated by re2c 1.1.1 on Mon Nov 5 23:34:07 2018 */ +/* Generated by re2c 1.1.1 on Tue Nov 13 23:39:33 2018 */ #line 1 "../src/ast/lex.re" #include "src/util/c99_stdint.h" #include @@ -985,56 +985,65 @@ scan: if (yybm[0+yych] & 16) { goto yy185; } - if (yych <= '.') { - if (yych <= '#') { + if (yych <= '9') { + if (yych <= '%') { if (yych <= '\r') { if (yych <= 0x08) goto yy183; if (yych <= '\n') goto yy188; if (yych >= '\r') goto yy190; } else { - if (yych <= 0x1F) goto yy183; - if (yych <= '!') goto yy191; - if (yych <= '"') goto yy193; - goto yy195; + if (yych <= '"') { + if (yych >= '"') goto yy191; + } else { + if (yych <= '#') goto yy193; + if (yych >= '%') goto yy194; + } } } else { - if (yych <= '\'') { - if (yych == '%') goto yy196; - if (yych >= '\'') goto yy197; + if (yych <= '*') { + if (yych <= '&') goto yy183; + if (yych <= '\'') goto yy195; + if (yych <= ')') goto yy197; + goto yy199; } else { - if (yych <= '*') { - if (yych <= ')') goto yy191; - goto yy199; + if (yych <= '-') { + if (yych <= '+') goto yy197; } else { - if (yych <= ',') goto yy191; - if (yych >= '.') goto yy200; + if (yych <= '.') goto yy200; + if (yych <= '/') goto yy202; } } } } else { - if (yych <= '\\') { - if (yych <= '?') { - if (yych <= '/') goto yy202; - if (yych <= '9') goto yy183; + if (yych <= '[') { + if (yych <= '=') { if (yych <= ':') goto yy203; - goto yy191; + if (yych <= ';') goto yy197; + if (yych <= '<') goto yy204; + goto yy206; } else { - if (yych <= '@') goto yy195; - if (yych <= 'Z') goto yy204; - if (yych <= '[') goto yy206; - goto yy191; + if (yych <= '?') { + if (yych >= '?') goto yy197; + } else { + if (yych <= '@') goto yy193; + if (yych <= 'Z') goto yy207; + goto yy210; + } } } else { if (yych <= 'q') { - if (yych == '_') goto yy204; - if (yych >= 'a') goto yy204; + if (yych <= '^') { + if (yych <= '\\') goto yy197; + } else { + if (yych != '`') goto yy207; + } } else { if (yych <= 'z') { - if (yych <= 'r') goto yy208; - goto yy204; + if (yych <= 'r') goto yy212; + goto yy207; } else { - if (yych <= '{') goto yy209; - if (yych <= '|') goto yy191; + if (yych <= '{') goto yy213; + if (yych <= '|') goto yy197; } } } @@ -1042,12 +1051,12 @@ scan: yy183: ++YYCURSOR; yy184: -#line 322 "../src/ast/lex.re" +#line 314 "../src/ast/lex.re" { fatal_lc(get_cline(), get_column(), "unexpected character: '%c'", *tok); goto scan; } -#line 1051 "src/ast/lex.cc" +#line 1060 "src/ast/lex.cc" yy185: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -1055,20 +1064,20 @@ yy185: if (yybm[0+yych] & 16) { goto yy185; } -#line 303 "../src/ast/lex.re" +#line 295 "../src/ast/lex.re" { goto scan; } -#line 1061 "src/ast/lex.cc" +#line 1070 "src/ast/lex.cc" yy188: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy211; + if (yych == '\t') goto yy215; } else { - if (yych <= ' ') goto yy211; - if (yych == '#') goto yy214; + if (yych <= ' ') goto yy215; + if (yych == '#') goto yy218; } yy189: -#line 310 "../src/ast/lex.re" +#line 302 "../src/ast/lex.re" { pos = cur; cline++; @@ -1080,104 +1089,115 @@ yy189: goto scan; } } -#line 1084 "src/ast/lex.cc" +#line 1093 "src/ast/lex.cc" yy190: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy188; goto yy184; yy191: ++YYCURSOR; -yy192: -#line 219 "../src/ast/lex.re" - { return *tok; } -#line 1094 "src/ast/lex.cc" -yy193: - ++YYCURSOR; -#line 209 "../src/ast/lex.re" +#line 212 "../src/ast/lex.re" { yylval.regexp = lex_str('"'); return TOKEN_REGEXP; } -#line 1099 "src/ast/lex.cc" -yy195: +#line 1102 "src/ast/lex.cc" +yy193: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '^') { if (yych <= '@') goto yy184; - if (yych <= 'Z') goto yy216; + if (yych <= 'Z') goto yy220; goto yy184; } else { if (yych == '`') goto yy184; - if (yych <= 'z') goto yy216; + if (yych <= 'z') goto yy220; goto yy184; } -yy196: +yy194: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '}') goto yy219; + if (yych == '}') goto yy223; goto yy184; -yy197: +yy195: ++YYCURSOR; -#line 208 "../src/ast/lex.re" +#line 211 "../src/ast/lex.re" { yylval.regexp = lex_str('\''); return TOKEN_REGEXP; } -#line 1119 "src/ast/lex.cc" +#line 1122 "src/ast/lex.cc" +yy197: + ++YYCURSOR; +yy198: +#line 222 "../src/ast/lex.re" + { return *tok; } +#line 1128 "src/ast/lex.cc" yy199: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '/') goto yy219; - goto yy192; + if (yych == '/') goto yy223; + goto yy198; yy200: ++YYCURSOR; -#line 298 "../src/ast/lex.re" +#line 290 "../src/ast/lex.re" { yylval.regexp = ast_dot(cline, get_column()); return TOKEN_REGEXP; } -#line 1131 "src/ast/lex.cc" +#line 1140 "src/ast/lex.cc" yy202: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '*') goto yy221; - if (yych == '/') goto yy223; - goto yy192; + if (yych == '*') goto yy225; + if (yych == '/') goto yy227; + goto yy198; yy203: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '=') goto yy225; + if (yych == '=') goto yy229; goto yy184; yy204: ++YYCURSOR; +#line 204 "../src/ast/lex.re" + { return lex_clist(); } +#line 1154 "src/ast/lex.cc" +yy206: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == '>') goto yy231; + goto yy198; +yy207: + ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy205: +yy208: if (yybm[0+yych] & 32) { - goto yy204; - } - if (yych <= ' ') { - if (yych == '\t') { - YYCTXMARKER = YYCURSOR; - goto yy229; - } - if (yych <= 0x1F) goto yy227; - YYCTXMARKER = YYCURSOR; - goto yy229; - } else { - if (yych <= ',') { - if (yych <= '+') goto yy227; - YYCTXMARKER = YYCURSOR; - goto yy231; - } else { - if (yych <= '<') goto yy227; - if (yych <= '>') { - YYCTXMARKER = YYCURSOR; - goto yy231; - } - goto yy227; - } + goto yy207; } -yy206: +#line 267 "../src/ast/lex.re" + { + if (!globopts->FFlag || lex_namedef_context_re2c()) { + yylval.str = new std::string (tok, tok_len()); + return TOKEN_ID; + } + else if (lex_namedef_context_flex()) { + yylval.str = new std::string (tok, tok_len()); + lexer_state = LEX_FLEX_NAME; + return TOKEN_FID; + } + else { + std::vector *str = new std::vector; + for (const char *s = tok; s < cur; ++s) { + const uint32_t + chr = static_cast(*s), + col = static_cast(s - tok); + str->push_back(ASTChar(chr, col)); + } + yylval.regexp = ast_str(cline, get_column(), str, false); + return TOKEN_REGEXP; + } + } +#line 1190 "src/ast/lex.cc" +yy210: yych = (YYCTYPE)*++YYCURSOR; if (yych == '^') goto yy233; -#line 210 "../src/ast/lex.re" +#line 213 "../src/ast/lex.re" { yylval.regexp = lex_cls(false); return TOKEN_REGEXP; } -#line 1176 "src/ast/lex.cc" -yy208: +#line 1196 "src/ast/lex.cc" +yy212: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy235; - goto yy205; -yy209: + goto yy208; +yy213: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 64) { @@ -1190,157 +1210,115 @@ yy209: if (yych <= '_') { if (yych >= '_') goto yy240; } else { - if (yych <= '`') goto yy210; + if (yych <= '`') goto yy214; if (yych <= 'z') goto yy240; } } -yy210: +yy214: #line 199 "../src/ast/lex.re" { lex_code_in_braces(); return TOKEN_CODE; } -#line 1201 "src/ast/lex.cc" -yy211: +#line 1221 "src/ast/lex.cc" +yy215: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy211; + if (yych == '\t') goto yy215; } else { - if (yych <= ' ') goto yy211; - if (yych == '#') goto yy214; + if (yych <= ' ') goto yy215; + if (yych == '#') goto yy218; } -yy213: +yy217: YYCURSOR = YYMARKER; if (yyaccept <= 1) { if (yyaccept == 0) { goto yy189; } else { - goto yy210; + goto yy214; } } else { goto yy237; } -yy214: +yy218: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy214; - goto yy213; + if (yych == '\t') goto yy218; + goto yy217; } else { - if (yych <= ' ') goto yy214; + if (yych <= ' ') goto yy218; if (yych == 'l') goto yy242; - goto yy213; + goto yy217; } -yy216: +yy220: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 'Z') { - if (yych <= '/') goto yy218; - if (yych <= '9') goto yy216; - if (yych >= 'A') goto yy216; + if (yych <= '/') goto yy222; + if (yych <= '9') goto yy220; + if (yych >= 'A') goto yy220; } else { if (yych <= '_') { - if (yych >= '_') goto yy216; + if (yych >= '_') goto yy220; } else { - if (yych <= '`') goto yy218; - if (yych <= 'z') goto yy216; + if (yych <= '`') goto yy222; + if (yych <= 'z') goto yy220; } } -yy218: -#line 213 "../src/ast/lex.re" +yy222: +#line 216 "../src/ast/lex.re" { const std::string *name = new std::string(tok + 1, tok_len() - 1); yylval.regexp = ast_tag(cline, get_column(), name, tok[0] == '#'); return TOKEN_REGEXP; } -#line 1258 "src/ast/lex.cc" -yy219: +#line 1278 "src/ast/lex.cc" +yy223: ++YYCURSOR; -#line 206 "../src/ast/lex.re" +#line 209 "../src/ast/lex.re" { tok = cur; return 0; } -#line 1263 "src/ast/lex.cc" -yy221: +#line 1283 "src/ast/lex.cc" +yy225: ++YYCURSOR; -#line 204 "../src/ast/lex.re" +#line 207 "../src/ast/lex.re" { lex_c_comment(); goto scan; } -#line 1268 "src/ast/lex.cc" -yy223: +#line 1288 "src/ast/lex.cc" +yy227: ++YYCURSOR; -#line 203 "../src/ast/lex.re" +#line 206 "../src/ast/lex.re" { lex_cpp_comment(); goto scan; } -#line 1273 "src/ast/lex.cc" -yy225: +#line 1293 "src/ast/lex.cc" +yy229: yych = (YYCTYPE)*++YYCURSOR; if (yych == '>') goto yy243; #line 200 "../src/ast/lex.re" { lex_code_indented(); return TOKEN_CODE; } -#line 1279 "src/ast/lex.cc" -yy227: - ++YYCURSOR; - YYCURSOR -= 1; -#line 280 "../src/ast/lex.re" - { - if (!globopts->FFlag) { - yylval.str = new std::string (tok, tok_len()); - return TOKEN_ID; - } - else { - std::vector *str = new std::vector; - for (char *s = tok; s < cur; ++s) { - const uint32_t - chr = static_cast(*s), - col = static_cast(s - tok); - str->push_back(ASTChar(chr, col)); - } - yylval.regexp = ast_str(cline, get_column(), str, false); - return TOKEN_REGEXP; - } - } -#line 1301 "src/ast/lex.cc" -yy229: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = (YYCTYPE)*YYCURSOR; - if (yych <= ' ') { - if (yych == '\t') goto yy229; - if (yych <= 0x1F) goto yy245; - goto yy229; - } else { - if (yych <= ',') { - if (yych <= '+') goto yy245; - } else { - if (yych <= '<') goto yy245; - if (yych >= '?') goto yy245; - } - } +#line 1299 "src/ast/lex.cc" yy231: ++YYCURSOR; - YYCURSOR = YYCTXMARKER; -#line 275 "../src/ast/lex.re" - { - yylval.str = new std::string (tok, tok_len ()); - return TOKEN_ID; - } -#line 1326 "src/ast/lex.cc" +#line 202 "../src/ast/lex.re" + { lex_cgoto(); return TOKEN_CNEXT; } +#line 1304 "src/ast/lex.cc" yy233: ++YYCURSOR; -#line 211 "../src/ast/lex.re" +#line 214 "../src/ast/lex.re" { yylval.regexp = lex_cls(true); return TOKEN_REGEXP; } -#line 1331 "src/ast/lex.cc" +#line 1309 "src/ast/lex.cc" yy235: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy247; - goto yy205; + if (yych == '2') goto yy245; + goto yy208; yy236: ++YYCURSOR; yy237: -#line 248 "../src/ast/lex.re" +#line 251 "../src/ast/lex.re" { fatal_lc(get_cline(), get_column(), "illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers"); } -#line 1344 "src/ast/lex.cc" +#line 1322 "src/ast/lex.cc" yy238: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -1348,70 +1326,54 @@ yy238: if (yybm[0+yych] & 64) { goto yy238; } - if (yych == ',') goto yy248; - if (yych == '}') goto yy249; - goto yy213; + if (yych == ',') goto yy246; + if (yych == '}') goto yy247; + goto yy217; yy240: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= '^') { if (yych <= '9') { - if (yych <= '/') goto yy213; + if (yych <= '/') goto yy217; goto yy240; } else { - if (yych <= '@') goto yy213; + if (yych <= '@') goto yy217; if (yych <= 'Z') goto yy240; - goto yy213; + goto yy217; } } else { if (yych <= 'z') { - if (yych == '`') goto yy213; + if (yych == '`') goto yy217; goto yy240; } else { - if (yych == '}') goto yy251; - goto yy213; + if (yych == '}') goto yy249; + goto yy217; } } yy242: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy253; - goto yy213; + if (yych == 'i') goto yy251; + goto yy217; yy243: ++YYCURSOR; - YYCURSOR -= 2; -#line 201 "../src/ast/lex.re" - { return *tok; } -#line 1386 "src/ast/lex.cc" +#line 203 "../src/ast/lex.re" + { lex_cgoto(); return TOKEN_CJUMP; } +#line 1363 "src/ast/lex.cc" yy245: - ++YYCURSOR; - YYCURSOR = YYCTXMARKER; -#line 264 "../src/ast/lex.re" - { - yylval.str = new std::string (tok, tok_len ()); - if (globopts->FFlag) { - lexer_state = LEX_FLEX_NAME; - return TOKEN_FID; - } - else { - return TOKEN_ID; - } - } -#line 1401 "src/ast/lex.cc" -yy247: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy254; - goto yy205; -yy248: + if (yych == 'c') goto yy252; + goto yy208; +yy246: yyaccept = 2; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy237; - if (yych <= '9') goto yy255; - if (yych == '}') goto yy257; + if (yych <= '9') goto yy253; + if (yych == '}') goto yy255; goto yy237; -yy249: +yy247: ++YYCURSOR; -#line 221 "../src/ast/lex.re" +#line 224 "../src/ast/lex.re" { if (!s_to_u32_unsafe (tok + 1, cur - 1, yylval.bounds.min)) { fatal_lc(get_cline(), get_column(), "repetition count overflow"); @@ -1419,10 +1381,10 @@ yy249: yylval.bounds.max = yylval.bounds.min; return TOKEN_CLOSESIZE; } -#line 1423 "src/ast/lex.cc" -yy251: +#line 1385 "src/ast/lex.cc" +yy249: ++YYCURSOR; -#line 253 "../src/ast/lex.re" +#line 256 "../src/ast/lex.re" { if (!globopts->FFlag) { fatal_lc(get_cline(), get_column(), @@ -1431,26 +1393,26 @@ yy251: yylval.str = new std::string (tok + 1, tok_len () - 2); // -2 to omit braces return TOKEN_ID; } -#line 1435 "src/ast/lex.cc" -yy253: +#line 1397 "src/ast/lex.cc" +yy251: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy259; - goto yy213; -yy254: + if (yych == 'n') goto yy257; + goto yy217; +yy252: yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy260; - goto yy205; -yy255: + if (yych == ':') goto yy258; + goto yy208; +yy253: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych <= '/') goto yy213; - if (yych <= '9') goto yy255; - if (yych == '}') goto yy262; - goto yy213; -yy257: + if (yych <= '/') goto yy217; + if (yych <= '9') goto yy253; + if (yych == '}') goto yy260; + goto yy217; +yy255: ++YYCURSOR; -#line 240 "../src/ast/lex.re" +#line 243 "../src/ast/lex.re" { if (!s_to_u32_unsafe (tok + 1, cur - 2, yylval.bounds.min)) { fatal_lc(get_cline(), get_column(), "repetition lower bound overflow"); @@ -1458,19 +1420,19 @@ yy257: yylval.bounds.max = std::numeric_limits::max(); return TOKEN_CLOSESIZE; } -#line 1462 "src/ast/lex.cc" -yy259: +#line 1424 "src/ast/lex.cc" +yy257: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy264; - goto yy213; -yy260: + if (yych == 'e') goto yy262; + goto yy217; +yy258: ++YYCURSOR; -#line 262 "../src/ast/lex.re" +#line 265 "../src/ast/lex.re" { return TOKEN_CONF; } -#line 1471 "src/ast/lex.cc" -yy262: +#line 1433 "src/ast/lex.cc" +yy260: ++YYCURSOR; -#line 229 "../src/ast/lex.re" +#line 232 "../src/ast/lex.re" { const char * p = strchr (tok, ','); if (!s_to_u32_unsafe (tok + 1, p, yylval.bounds.min)) { @@ -1481,94 +1443,733 @@ yy262: } return TOKEN_CLOSESIZE; } -#line 1485 "src/ast/lex.cc" -yy264: +#line 1447 "src/ast/lex.cc" +yy262: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '0') goto yy266; - if (yych <= '9') goto yy213; - goto yy266; -yy265: + if (yych <= '0') goto yy264; + if (yych <= '9') goto yy217; + goto yy264; +yy263: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy266: +yy264: if (yych <= 0x1F) { - if (yych == '\t') goto yy265; - goto yy213; + if (yych == '\t') goto yy263; + goto yy217; } else { - if (yych <= ' ') goto yy265; - if (yych <= '0') goto yy213; - if (yych >= ':') goto yy213; + if (yych <= ' ') goto yy263; + if (yych <= '0') goto yy217; + if (yych >= ':') goto yy217; YYCTXMARKER = YYCURSOR; } -yy267: +yy265: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\r') { if (yych <= '\t') { - if (yych <= 0x08) goto yy213; + if (yych <= 0x08) goto yy217; } else { - if (yych <= '\n') goto yy271; - if (yych <= '\f') goto yy213; - goto yy273; + if (yych <= '\n') goto yy269; + if (yych <= '\f') goto yy217; + goto yy271; } } else { if (yych <= ' ') { - if (yych <= 0x1F) goto yy213; + if (yych <= 0x1F) goto yy217; } else { - if (yych <= '/') goto yy213; - if (yych <= '9') goto yy267; - goto yy213; + if (yych <= '/') goto yy217; + if (yych <= '9') goto yy265; + goto yy217; } } +yy267: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yych <= 0x1F) { + if (yych == '\t') goto yy267; + goto yy217; + } else { + if (yych <= ' ') goto yy267; + if (yych == '"') goto yy272; + goto yy217; + } yy269: ++YYCURSOR; + YYCURSOR = YYCTXMARKER; +#line 297 "../src/ast/lex.re" + { + set_sourceline (); + return TOKEN_LINE_INFO; + } +#line 1508 "src/ast/lex.cc" +yy271: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == '\n') goto yy269; + goto yy217; +yy272: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 128) { + goto yy272; + } + if (yych <= '\n') goto yy217; + if (yych >= '#') goto yy275; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == '\n') goto yy269; + if (yych == '\r') goto yy271; + goto yy217; +yy275: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yych <= 0x00) goto yy217; + if (yych == '\n') goto yy217; + goto yy272; +} +#line 318 "../src/ast/lex.re" + +} + +bool Scanner::lex_namedef_context_re2c() +{ + +#line 1541 "src/ast/lex.cc" +{ + YYCTYPE yych; + static const unsigned char yybm[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = (YYCTYPE)*(YYMARKER = YYCURSOR); + if (yych <= 0x1F) { + if (yych == '\t') { + YYCTXMARKER = YYCURSOR; + goto yy279; + } + } else { + if (yych <= ' ') { + YYCTXMARKER = YYCURSOR; + goto yy279; + } + if (yych == '=') { + YYCTXMARKER = YYCURSOR; + goto yy282; + } + } +yy278: +#line 325 "../src/ast/lex.re" + { return false; } +#line 1598 "src/ast/lex.cc" +yy279: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 128) { + goto yy279; + } + if (yych == '=') goto yy282; +yy281: + YYCURSOR = YYMARKER; + goto yy278; +yy282: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == '>') goto yy281; + ++YYCURSOR; + YYCURSOR = YYCTXMARKER; +#line 324 "../src/ast/lex.re" + { return true; } +#line 1617 "src/ast/lex.cc" +} +#line 326 "../src/ast/lex.re" + +} + +bool Scanner::lex_namedef_context_flex() +{ + +#line 1626 "src/ast/lex.cc" +{ + YYCTYPE yych; + static const unsigned char yybm[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yych == '\t') { + YYCTXMARKER = YYCURSOR; + goto yy288; + } + if (yych == ' ') { + YYCTXMARKER = YYCURSOR; + goto yy288; + } +#line 334 "../src/ast/lex.re" + { return false; } +#line 1675 "src/ast/lex.cc" +yy288: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 128) { + goto yy288; + } + if (yych <= '<') { + if (yych == ':') goto yy291; + } else { + if (yych <= '=') goto yy291; + if (yych == '{') goto yy291; + } + YYCURSOR = YYCTXMARKER; +#line 333 "../src/ast/lex.re" + { return true; } +#line 1692 "src/ast/lex.cc" +yy291: + ++YYCURSOR; + YYCURSOR = YYCTXMARKER; +#line 332 "../src/ast/lex.re" + { return false; } +#line 1698 "src/ast/lex.cc" +} +#line 335 "../src/ast/lex.re" + +} + +int Scanner::lex_clist() +{ + int kind = TOKEN_CLIST; + CondList *cl = NULL; + +#line 1709 "src/ast/lex.cc" +{ + YYCTYPE yych; + static const unsigned char yybm[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; + goto yy293; +yy294: + ++YYCURSOR; +yy293: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 128) { + goto yy294; + } + if (yych <= 0x1F) goto yy296; + if (yych <= '!') goto yy297; + if (yych == '>') goto yy300; +yy296: +#line 345 "../src/ast/lex.re" + { goto fst; } +#line 1761 "src/ast/lex.cc" +yy297: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yych == '\t') goto yy297; + if (yych == ' ') goto yy297; +#line 343 "../src/ast/lex.re" + { kind = TOKEN_CSETUP; goto fst; } +#line 1770 "src/ast/lex.cc" +yy300: + ++YYCURSOR; +#line 344 "../src/ast/lex.re" + { kind = TOKEN_CZERO; goto end; } +#line 1775 "src/ast/lex.cc" +} +#line 346 "../src/ast/lex.re" + +fst: + cl = new CondList; + tok = cur; + +#line 1783 "src/ast/lex.cc" +{ + YYCTYPE yych; + static const unsigned char yybm[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 0, 0, 0, 0, 0, 0, + 0, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 0, 0, 0, 0, 64, + 0, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = (YYCTYPE)*YYCURSOR; + if (yych <= 'Z') { + if (yych == '*') goto yy306; + if (yych >= 'A') goto yy307; + } else { + if (yych <= '_') { + if (yych >= '_') goto yy307; + } else { + if (yych <= '`') goto yy304; + if (yych <= 'z') goto yy307; + } + } +yy304: + ++YYCURSOR; +yy305: +#line 353 "../src/ast/lex.re" + { goto error; } +#line 1838 "src/ast/lex.cc" +yy306: + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yybm[0+yych] & 128) { + goto yy310; + } + if (yych == '>') goto yy313; + goto yy305; +yy307: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 64) { + goto yy307; + } +#line 352 "../src/ast/lex.re" + { cl->insert(std::string(tok, tok_len())); goto sep; } +#line 1855 "src/ast/lex.cc" +yy310: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 128) { + goto yy310; + } + if (yych == '>') goto yy313; + YYCURSOR = YYMARKER; + goto yy305; +yy313: + ++YYCURSOR; +#line 351 "../src/ast/lex.re" + { cl->insert("*"); goto end; } +#line 1870 "src/ast/lex.cc" +} +#line 354 "../src/ast/lex.re" + +sep: + +#line 1876 "src/ast/lex.cc" +{ + YYCTYPE yych; + static const unsigned char yybm[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = (YYCTYPE)*YYCURSOR; + if (yych <= ' ') { + if (yych == '\t') goto yy319; + if (yych >= ' ') goto yy319; + } else { + if (yych <= ',') { + if (yych >= ',') goto yy320; + } else { + if (yych == '>') goto yy323; + } + } + ++YYCURSOR; +yy318: +#line 359 "../src/ast/lex.re" + { goto error; } +#line 1929 "src/ast/lex.cc" +yy319: + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych <= ' ') { + if (yych == '\t') goto yy325; + if (yych <= 0x1F) goto yy318; + goto yy325; + } else { + if (yych <= ',') { + if (yych <= '+') goto yy318; + } else { + if (yych == '>') goto yy323; + goto yy318; + } + } +yy320: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 128) { + goto yy320; + } +#line 357 "../src/ast/lex.re" + { goto next; } +#line 1953 "src/ast/lex.cc" +yy323: + ++YYCURSOR; +#line 358 "../src/ast/lex.re" + { goto end; } +#line 1958 "src/ast/lex.cc" +yy325: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yych <= ' ') { + if (yych == '\t') goto yy325; + if (yych >= ' ') goto yy325; + } else { + if (yych <= ',') { + if (yych >= ',') goto yy320; + } else { + if (yych == '>') goto yy323; + } + } + YYCURSOR = YYMARKER; + goto yy318; +} +#line 360 "../src/ast/lex.re" + +next: + tok = cur; + +#line 1981 "src/ast/lex.cc" +{ + YYCTYPE yych; + static const unsigned char yybm[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 0, 0, 0, 0, 0, 0, + 0, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 0, 0, 0, 0, 128, + 0, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yych <= '^') { + if (yych <= '@') goto yy330; + if (yych <= 'Z') goto yy332; + } else { + if (yych == '`') goto yy330; + if (yych <= 'z') goto yy332; + } +yy330: + ++YYCURSOR; +#line 365 "../src/ast/lex.re" + { goto error; } +#line 2031 "src/ast/lex.cc" +yy332: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 128) { + goto yy332; + } +#line 364 "../src/ast/lex.re" + { cl->insert(std::string(tok, tok_len())); goto sep; } +#line 2041 "src/ast/lex.cc" +} +#line 366 "../src/ast/lex.re" + +end: + yylval.clist = cl; + return kind; +error: + delete cl; + fatal_l(get_cline(), "syntax error in condition list"); +} + +void Scanner::lex_cgoto() +{ + +#line 2056 "src/ast/lex.cc" +{ + YYCTYPE yych; + static const unsigned char yybm[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; + goto yy335; +yy336: + ++YYCURSOR; +yy335: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 128) { + goto yy336; + } +#line 378 "../src/ast/lex.re" + { goto name; } +#line 2104 "src/ast/lex.cc" +} +#line 379 "../src/ast/lex.re" + +name: + tok = cur; + +#line 2111 "src/ast/lex.cc" +{ + YYCTYPE yych; + static const unsigned char yybm[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 0, 0, 0, 0, 0, 0, + 0, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 0, 0, 0, 0, 128, + 0, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x1F) { - if (yych == '\t') goto yy269; - goto yy213; + if (yych <= '^') { + if (yych <= '@') goto yy341; + if (yych <= 'Z') goto yy343; } else { - if (yych <= ' ') goto yy269; - if (yych == '"') goto yy274; - goto yy213; + if (yych == '`') goto yy341; + if (yych <= 'z') goto yy343; } -yy271: +yy341: ++YYCURSOR; - YYCURSOR = YYCTXMARKER; -#line 305 "../src/ast/lex.re" - { - set_sourceline (); - return TOKEN_LINE_INFO; - } -#line 1546 "src/ast/lex.cc" -yy273: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy271; - goto yy213; -yy274: +#line 384 "../src/ast/lex.re" + { fatal_l(get_cline(), "syntax error in condition goto"); } +#line 2161 "src/ast/lex.cc" +yy343: ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy274; + goto yy343; } - if (yych <= '\n') goto yy213; - if (yych >= '#') goto yy277; - yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy271; - if (yych == '\r') goto yy273; - goto yy213; -yy277: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x00) goto yy213; - if (yych == '\n') goto yy213; - goto yy274; +#line 383 "../src/ast/lex.re" + { yylval.str = new std::string (tok, tok_len ()); return; } +#line 2171 "src/ast/lex.cc" } -#line 326 "../src/ast/lex.re" +#line 385 "../src/ast/lex.re" } @@ -1578,98 +2179,98 @@ void Scanner::lex_code_indented() tok = cur; code: -#line 1582 "src/ast/lex.cc" +#line 2183 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = (YYCTYPE)*YYCURSOR; if (yych <= '&') { if (yych <= '\f') { - if (yych <= 0x00) goto yy280; - if (yych == '\n') goto yy284; - goto yy282; + if (yych <= 0x00) goto yy348; + if (yych == '\n') goto yy352; + goto yy350; } else { - if (yych <= '\r') goto yy286; - if (yych == '"') goto yy287; - goto yy282; + if (yych <= '\r') goto yy354; + if (yych == '"') goto yy355; + goto yy350; } } else { if (yych <= 'z') { - if (yych <= '\'') goto yy287; - if (yych == '/') goto yy289; - goto yy282; + if (yych <= '\'') goto yy355; + if (yych == '/') goto yy357; + goto yy350; } else { - if (yych == '|') goto yy282; - if (yych <= '}') goto yy290; - goto yy282; + if (yych == '|') goto yy350; + if (yych <= '}') goto yy358; + goto yy350; } } -yy280: +yy348: ++YYCURSOR; -#line 343 "../src/ast/lex.re" +#line 402 "../src/ast/lex.re" { fail_if_eof(); goto code; } -#line 1612 "src/ast/lex.cc" -yy282: +#line 2213 "src/ast/lex.cc" +yy350: ++YYCURSOR; -yy283: -#line 348 "../src/ast/lex.re" +yy351: +#line 407 "../src/ast/lex.re" { goto code; } -#line 1618 "src/ast/lex.cc" -yy284: +#line 2219 "src/ast/lex.cc" +yy352: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '\f') { - if (yych <= 0x08) goto yy285; - if (yych <= '\n') goto yy292; + if (yych <= 0x08) goto yy353; + if (yych <= '\n') goto yy360; } else { - if (yych <= '\r') goto yy292; - if (yych == ' ') goto yy292; + if (yych <= '\r') goto yy360; + if (yych == ' ') goto yy360; } -yy285: -#line 336 "../src/ast/lex.re" +yy353: +#line 395 "../src/ast/lex.re" { while (isspace(tok[0])) ++tok; while (cur > tok && isspace(cur[-1])) --cur; yylval.code = new Code(get_fname (), line, tok, tok_len ()); return; } -#line 1636 "src/ast/lex.cc" -yy286: +#line 2237 "src/ast/lex.cc" +yy354: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy284; - goto yy283; -yy287: + if (yych == '\n') goto yy352; + goto yy351; +yy355: ++YYCURSOR; -#line 347 "../src/ast/lex.re" +#line 406 "../src/ast/lex.re" { lex_string(cur[-1]); goto code; } -#line 1645 "src/ast/lex.cc" -yy289: +#line 2246 "src/ast/lex.cc" +yy357: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '*') goto yy294; - if (yych == '/') goto yy296; - goto yy283; -yy290: + if (yych == '*') goto yy362; + if (yych == '/') goto yy364; + goto yy351; +yy358: ++YYCURSOR; -#line 344 "../src/ast/lex.re" +#line 403 "../src/ast/lex.re" { fatal_l(get_cline(), "Curly braces are not allowed after ':='"); } -#line 1655 "src/ast/lex.cc" -yy292: +#line 2256 "src/ast/lex.cc" +yy360: ++YYCURSOR; YYCURSOR -= 1; -#line 335 "../src/ast/lex.re" +#line 394 "../src/ast/lex.re" { goto code; } -#line 1661 "src/ast/lex.cc" -yy294: +#line 2262 "src/ast/lex.cc" +yy362: ++YYCURSOR; -#line 345 "../src/ast/lex.re" +#line 404 "../src/ast/lex.re" { lex_c_comment(); goto code; } -#line 1666 "src/ast/lex.cc" -yy296: +#line 2267 "src/ast/lex.cc" +yy364: ++YYCURSOR; -#line 346 "../src/ast/lex.re" +#line 405 "../src/ast/lex.re" { lex_cpp_comment(); goto code; } -#line 1671 "src/ast/lex.cc" +#line 2272 "src/ast/lex.cc" } -#line 349 "../src/ast/lex.re" +#line 408 "../src/ast/lex.re" } @@ -1679,7 +2280,7 @@ void Scanner::lex_code_in_braces() uint32_t depth = 1; code: -#line 1683 "src/ast/lex.cc" +#line 2284 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -1720,68 +2321,68 @@ code: yych = (YYCTYPE)*YYCURSOR; if (yych <= '&') { if (yych <= '\f') { - if (yych <= 0x00) goto yy300; - if (yych == '\n') goto yy304; - goto yy302; + if (yych <= 0x00) goto yy368; + if (yych == '\n') goto yy372; + goto yy370; } else { - if (yych <= '\r') goto yy306; - if (yych == '"') goto yy307; - goto yy302; + if (yych <= '\r') goto yy374; + if (yych == '"') goto yy375; + goto yy370; } } else { if (yych <= 'z') { - if (yych <= '\'') goto yy307; - if (yych == '/') goto yy309; - goto yy302; + if (yych <= '\'') goto yy375; + if (yych == '/') goto yy377; + goto yy370; } else { - if (yych <= '{') goto yy310; - if (yych == '}') goto yy312; - goto yy302; + if (yych <= '{') goto yy378; + if (yych == '}') goto yy380; + goto yy370; } } -yy300: +yy368: ++YYCURSOR; -#line 369 "../src/ast/lex.re" +#line 428 "../src/ast/lex.re" { fail_if_eof(); goto code; } -#line 1747 "src/ast/lex.cc" -yy302: +#line 2348 "src/ast/lex.cc" +yy370: ++YYCURSOR; -yy303: -#line 373 "../src/ast/lex.re" +yy371: +#line 432 "../src/ast/lex.re" { goto code; } -#line 1753 "src/ast/lex.cc" -yy304: +#line 2354 "src/ast/lex.cc" +yy372: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 32) { - goto yy314; + goto yy382; } - if (yych == '#') goto yy317; -yy305: -#line 368 "../src/ast/lex.re" + if (yych == '#') goto yy385; +yy373: +#line 427 "../src/ast/lex.re" { pos = cur; cline++; goto code; } -#line 1763 "src/ast/lex.cc" -yy306: +#line 2364 "src/ast/lex.cc" +yy374: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy304; - goto yy303; -yy307: + if (yych == '\n') goto yy372; + goto yy371; +yy375: ++YYCURSOR; -#line 372 "../src/ast/lex.re" +#line 431 "../src/ast/lex.re" { lex_string(cur[-1]); goto code; } -#line 1772 "src/ast/lex.cc" -yy309: +#line 2373 "src/ast/lex.cc" +yy377: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '*') goto yy319; - if (yych == '/') goto yy321; - goto yy303; -yy310: + if (yych == '*') goto yy387; + if (yych == '/') goto yy389; + goto yy371; +yy378: ++YYCURSOR; -#line 366 "../src/ast/lex.re" +#line 425 "../src/ast/lex.re" { ++depth; goto code; } -#line 1782 "src/ast/lex.cc" -yy312: +#line 2383 "src/ast/lex.cc" +yy380: ++YYCURSOR; -#line 358 "../src/ast/lex.re" +#line 417 "../src/ast/lex.re" { if (--depth == 0) { yylval.code = new Code(get_fname (), line, tok, tok_len ()); @@ -1789,125 +2390,125 @@ yy312: } goto code; } -#line 1793 "src/ast/lex.cc" -yy314: +#line 2394 "src/ast/lex.cc" +yy382: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 32) { - goto yy314; + goto yy382; } - if (yych == '#') goto yy317; -yy316: + if (yych == '#') goto yy385; +yy384: YYCURSOR = YYMARKER; - goto yy305; -yy317: + goto yy373; +yy385: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy317; - goto yy316; + if (yych == '\t') goto yy385; + goto yy384; } else { - if (yych <= ' ') goto yy317; - if (yych == 'l') goto yy323; - goto yy316; + if (yych <= ' ') goto yy385; + if (yych == 'l') goto yy391; + goto yy384; } -yy319: +yy387: ++YYCURSOR; -#line 370 "../src/ast/lex.re" +#line 429 "../src/ast/lex.re" { lex_c_comment(); goto code; } -#line 1821 "src/ast/lex.cc" -yy321: +#line 2422 "src/ast/lex.cc" +yy389: ++YYCURSOR; -#line 371 "../src/ast/lex.re" +#line 430 "../src/ast/lex.re" { lex_cpp_comment(); goto code; } -#line 1826 "src/ast/lex.cc" -yy323: +#line 2427 "src/ast/lex.cc" +yy391: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy316; + if (yych != 'i') goto yy384; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy316; + if (yych != 'n') goto yy384; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy316; + if (yych != 'e') goto yy384; yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '0') goto yy328; - if (yych <= '9') goto yy316; - goto yy328; -yy327: + if (yych <= '0') goto yy396; + if (yych <= '9') goto yy384; + goto yy396; +yy395: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy328: +yy396: if (yych <= 0x1F) { - if (yych == '\t') goto yy327; - goto yy316; + if (yych == '\t') goto yy395; + goto yy384; } else { - if (yych <= ' ') goto yy327; - if (yych <= '0') goto yy316; - if (yych >= ':') goto yy316; + if (yych <= ' ') goto yy395; + if (yych <= '0') goto yy384; + if (yych >= ':') goto yy384; YYCTXMARKER = YYCURSOR; } -yy329: +yy397: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 64) { - goto yy329; + goto yy397; } if (yych <= '\f') { - if (yych <= 0x08) goto yy316; - if (yych <= '\t') goto yy331; - if (yych <= '\n') goto yy333; - goto yy316; + if (yych <= 0x08) goto yy384; + if (yych <= '\t') goto yy399; + if (yych <= '\n') goto yy401; + goto yy384; } else { - if (yych <= '\r') goto yy335; - if (yych != ' ') goto yy316; + if (yych <= '\r') goto yy403; + if (yych != ' ') goto yy384; } -yy331: +yy399: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy331; - goto yy316; + if (yych == '\t') goto yy399; + goto yy384; } else { - if (yych <= ' ') goto yy331; - if (yych == '"') goto yy336; - goto yy316; + if (yych <= ' ') goto yy399; + if (yych == '"') goto yy404; + goto yy384; } -yy333: +yy401: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 367 "../src/ast/lex.re" +#line 426 "../src/ast/lex.re" { set_sourceline (); goto code; } -#line 1885 "src/ast/lex.cc" -yy335: +#line 2486 "src/ast/lex.cc" +yy403: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy333; - goto yy316; -yy336: + if (yych == '\n') goto yy401; + goto yy384; +yy404: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy336; + goto yy404; } - if (yych <= '\n') goto yy316; - if (yych >= '#') goto yy339; + if (yych <= '\n') goto yy384; + if (yych >= '#') goto yy407; yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy333; - if (yych == '\r') goto yy335; - goto yy316; -yy339: + if (yych == '\n') goto yy401; + if (yych == '\r') goto yy403; + goto yy384; +yy407: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x00) goto yy316; - if (yych == '\n') goto yy316; - goto yy336; + if (yych <= 0x00) goto yy384; + if (yych == '\n') goto yy384; + goto yy404; } -#line 374 "../src/ast/lex.re" +#line 433 "../src/ast/lex.re" } @@ -1915,70 +2516,70 @@ void Scanner::lex_string(char delim) { loop: -#line 1919 "src/ast/lex.cc" +#line 2520 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= '!') { if (yych <= '\n') { - if (yych <= 0x00) goto yy342; - if (yych <= '\t') goto yy344; - goto yy346; + if (yych <= 0x00) goto yy410; + if (yych <= '\t') goto yy412; + goto yy414; } else { - if (yych == '\r') goto yy348; - goto yy344; + if (yych == '\r') goto yy416; + goto yy412; } } else { if (yych <= '\'') { - if (yych <= '"') goto yy349; - if (yych <= '&') goto yy344; - goto yy349; + if (yych <= '"') goto yy417; + if (yych <= '&') goto yy412; + goto yy417; } else { - if (yych == '\\') goto yy351; - goto yy344; + if (yych == '\\') goto yy419; + goto yy412; } } -yy342: +yy410: ++YYCURSOR; -#line 384 "../src/ast/lex.re" +#line 443 "../src/ast/lex.re" { fail_if_eof(); goto loop; } -#line 1947 "src/ast/lex.cc" -yy344: +#line 2548 "src/ast/lex.cc" +yy412: ++YYCURSOR; -yy345: -#line 385 "../src/ast/lex.re" +yy413: +#line 444 "../src/ast/lex.re" { goto loop; } -#line 1953 "src/ast/lex.cc" -yy346: +#line 2554 "src/ast/lex.cc" +yy414: ++YYCURSOR; -#line 383 "../src/ast/lex.re" +#line 442 "../src/ast/lex.re" { pos = cur; ++cline; goto loop; } -#line 1958 "src/ast/lex.cc" -yy348: +#line 2559 "src/ast/lex.cc" +yy416: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy346; - goto yy345; -yy349: + if (yych == '\n') goto yy414; + goto yy413; +yy417: ++YYCURSOR; -#line 381 "../src/ast/lex.re" +#line 440 "../src/ast/lex.re" { if (cur[-1] == delim) return; else goto loop; } -#line 1967 "src/ast/lex.cc" -yy351: +#line 2568 "src/ast/lex.cc" +yy419: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '&') { - if (yych != '"') goto yy345; + if (yych != '"') goto yy413; } else { - if (yych <= '\'') goto yy352; - if (yych != '\\') goto yy345; + if (yych <= '\'') goto yy420; + if (yych != '\\') goto yy413; } -yy352: +yy420: ++YYCURSOR; -#line 382 "../src/ast/lex.re" +#line 441 "../src/ast/lex.re" { goto loop; } -#line 1980 "src/ast/lex.cc" +#line 2581 "src/ast/lex.cc" } -#line 386 "../src/ast/lex.re" +#line 445 "../src/ast/lex.re" } @@ -1986,49 +2587,49 @@ void Scanner::lex_c_comment() { loop: -#line 1990 "src/ast/lex.cc" +#line 2591 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\f') { - if (yych <= 0x00) goto yy356; - if (yych == '\n') goto yy360; - goto yy358; + if (yych <= 0x00) goto yy424; + if (yych == '\n') goto yy428; + goto yy426; } else { - if (yych <= '\r') goto yy362; - if (yych == '*') goto yy363; - goto yy358; + if (yych <= '\r') goto yy430; + if (yych == '*') goto yy431; + goto yy426; } -yy356: +yy424: ++YYCURSOR; -#line 395 "../src/ast/lex.re" +#line 454 "../src/ast/lex.re" { fail_if_eof(); goto loop; } -#line 2008 "src/ast/lex.cc" -yy358: +#line 2609 "src/ast/lex.cc" +yy426: ++YYCURSOR; -yy359: -#line 396 "../src/ast/lex.re" +yy427: +#line 455 "../src/ast/lex.re" { goto loop; } -#line 2014 "src/ast/lex.cc" -yy360: +#line 2615 "src/ast/lex.cc" +yy428: ++YYCURSOR; -#line 394 "../src/ast/lex.re" +#line 453 "../src/ast/lex.re" { pos = cur; ++cline; goto loop; } -#line 2019 "src/ast/lex.cc" -yy362: +#line 2620 "src/ast/lex.cc" +yy430: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy360; - goto yy359; -yy363: + if (yych == '\n') goto yy428; + goto yy427; +yy431: yych = (YYCTYPE)*++YYCURSOR; - if (yych != '/') goto yy359; + if (yych != '/') goto yy427; ++YYCURSOR; -#line 393 "../src/ast/lex.re" +#line 452 "../src/ast/lex.re" { return; } -#line 2030 "src/ast/lex.cc" +#line 2631 "src/ast/lex.cc" } -#line 397 "../src/ast/lex.re" +#line 456 "../src/ast/lex.re" } @@ -2036,41 +2637,41 @@ void Scanner::lex_cpp_comment() { loop: -#line 2040 "src/ast/lex.cc" +#line 2641 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\n') { - if (yych <= 0x00) goto yy368; - if (yych <= '\t') goto yy370; - goto yy372; + if (yych <= 0x00) goto yy436; + if (yych <= '\t') goto yy438; + goto yy440; } else { - if (yych == '\r') goto yy374; - goto yy370; + if (yych == '\r') goto yy442; + goto yy438; } -yy368: +yy436: ++YYCURSOR; -#line 405 "../src/ast/lex.re" +#line 464 "../src/ast/lex.re" { fail_if_eof(); goto loop; } -#line 2057 "src/ast/lex.cc" -yy370: +#line 2658 "src/ast/lex.cc" +yy438: ++YYCURSOR; -yy371: -#line 406 "../src/ast/lex.re" +yy439: +#line 465 "../src/ast/lex.re" { goto loop; } -#line 2063 "src/ast/lex.cc" -yy372: +#line 2664 "src/ast/lex.cc" +yy440: ++YYCURSOR; -#line 404 "../src/ast/lex.re" +#line 463 "../src/ast/lex.re" { pos = cur; ++cline; return; } -#line 2068 "src/ast/lex.cc" -yy374: +#line 2669 "src/ast/lex.cc" +yy442: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy372; - goto yy371; + if (yych == '\n') goto yy440; + goto yy439; } -#line 407 "../src/ast/lex.re" +#line 466 "../src/ast/lex.re" } @@ -2082,44 +2683,44 @@ fst: tok = cur; c = get_column(); -#line 2086 "src/ast/lex.cc" +#line 2687 "src/ast/lex.cc" { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == ']') goto yy378; -#line 419 "../src/ast/lex.re" + if (yych == ']') goto yy446; +#line 478 "../src/ast/lex.re" { l = lex_cls_chr(); goto snd; } -#line 2094 "src/ast/lex.cc" -yy378: +#line 2695 "src/ast/lex.cc" +yy446: ++YYCURSOR; -#line 418 "../src/ast/lex.re" +#line 477 "../src/ast/lex.re" { return ast_cls(cline, c0, cls, neg); } -#line 2099 "src/ast/lex.cc" +#line 2700 "src/ast/lex.cc" } -#line 420 "../src/ast/lex.re" +#line 479 "../src/ast/lex.re" snd: -#line 2105 "src/ast/lex.cc" +#line 2706 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*(YYMARKER = YYCURSOR); - if (yych == '-') goto yy383; -yy382: -#line 423 "../src/ast/lex.re" + if (yych == '-') goto yy451; +yy450: +#line 482 "../src/ast/lex.re" { u = l; goto add; } -#line 2114 "src/ast/lex.cc" -yy383: +#line 2715 "src/ast/lex.cc" +yy451: yych = (YYCTYPE)*++YYCURSOR; - if (yych != ']') goto yy385; + if (yych != ']') goto yy453; YYCURSOR = YYMARKER; - goto yy382; -yy385: + goto yy450; +yy453: ++YYCURSOR; YYCURSOR -= 1; -#line 424 "../src/ast/lex.re" +#line 483 "../src/ast/lex.re" { u = lex_cls_chr(); if (l > u) { @@ -2128,9 +2729,9 @@ yy385: } goto add; } -#line 2132 "src/ast/lex.cc" +#line 2733 "src/ast/lex.cc" } -#line 432 "../src/ast/lex.re" +#line 491 "../src/ast/lex.re" add: cls->push_back(ASTRange(l, u, c)); @@ -2142,319 +2743,319 @@ uint32_t Scanner::lex_cls_chr() tok = cur; const uint32_t l = get_cline(), c = get_column(); -#line 2146 "src/ast/lex.cc" +#line 2747 "src/ast/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; if ((YYLIMIT - YYCURSOR) < 10) YYFILL(10); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\f') { - if (yych <= 0x00) goto yy389; - if (yych == '\n') goto yy393; - goto yy391; + if (yych <= 0x00) goto yy457; + if (yych == '\n') goto yy461; + goto yy459; } else { - if (yych <= '\r') goto yy395; - if (yych == '\\') goto yy396; - goto yy391; + if (yych <= '\r') goto yy463; + if (yych == '\\') goto yy464; + goto yy459; } -yy389: +yy457: ++YYCURSOR; -#line 444 "../src/ast/lex.re" +#line 503 "../src/ast/lex.re" { fail_if_eof(); return 0; } -#line 2165 "src/ast/lex.cc" -yy391: +#line 2766 "src/ast/lex.cc" +yy459: ++YYCURSOR; -yy392: -#line 450 "../src/ast/lex.re" +yy460: +#line 509 "../src/ast/lex.re" { return static_cast(tok[0]); } -#line 2171 "src/ast/lex.cc" -yy393: +#line 2772 "src/ast/lex.cc" +yy461: ++YYCURSOR; -#line 445 "../src/ast/lex.re" +#line 504 "../src/ast/lex.re" { fatal_lc(l, c, "newline in character class"); } -#line 2176 "src/ast/lex.cc" -yy395: +#line 2777 "src/ast/lex.cc" +yy463: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy393; - goto yy392; -yy396: + if (yych == '\n') goto yy461; + goto yy460; +yy464: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '\\') { if (yych <= '/') { if (yych <= '\f') { - if (yych <= 0x00) goto yy397; - if (yych == '\n') goto yy393; - goto yy398; + if (yych <= 0x00) goto yy465; + if (yych == '\n') goto yy461; + goto yy466; } else { - if (yych <= '\r') goto yy400; - if (yych == '-') goto yy401; - goto yy398; + if (yych <= '\r') goto yy468; + if (yych == '-') goto yy469; + goto yy466; } } else { if (yych <= 'U') { - if (yych <= '3') goto yy403; - if (yych <= '7') goto yy405; - if (yych <= 'T') goto yy398; - goto yy406; + if (yych <= '3') goto yy471; + if (yych <= '7') goto yy473; + if (yych <= 'T') goto yy466; + goto yy474; } else { - if (yych == 'X') goto yy408; - if (yych <= '[') goto yy398; - goto yy409; + if (yych == 'X') goto yy476; + if (yych <= '[') goto yy466; + goto yy477; } } } else { if (yych <= 'n') { if (yych <= 'b') { - if (yych <= ']') goto yy411; - if (yych <= '`') goto yy398; - if (yych <= 'a') goto yy413; - goto yy415; + if (yych <= ']') goto yy479; + if (yych <= '`') goto yy466; + if (yych <= 'a') goto yy481; + goto yy483; } else { - if (yych == 'f') goto yy417; - if (yych <= 'm') goto yy398; - goto yy419; + if (yych == 'f') goto yy485; + if (yych <= 'm') goto yy466; + goto yy487; } } else { if (yych <= 't') { - if (yych == 'r') goto yy421; - if (yych <= 's') goto yy398; - goto yy423; + if (yych == 'r') goto yy489; + if (yych <= 's') goto yy466; + goto yy491; } else { if (yych <= 'v') { - if (yych <= 'u') goto yy408; - goto yy425; + if (yych <= 'u') goto yy476; + goto yy493; } else { - if (yych == 'x') goto yy427; - goto yy398; + if (yych == 'x') goto yy495; + goto yy466; } } } } -yy397: -#line 448 "../src/ast/lex.re" +yy465: +#line 507 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in escape sequence"); } -#line 2237 "src/ast/lex.cc" -yy398: +#line 2838 "src/ast/lex.cc" +yy466: ++YYCURSOR; -yy399: -#line 463 "../src/ast/lex.re" +yy467: +#line 522 "../src/ast/lex.re" { warn.useless_escape(cline, get_column(), tok[1]); return static_cast(tok[1]); } -#line 2246 "src/ast/lex.cc" -yy400: +#line 2847 "src/ast/lex.cc" +yy468: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy393; - goto yy399; -yy401: + if (yych == '\n') goto yy461; + goto yy467; +yy469: ++YYCURSOR; -#line 461 "../src/ast/lex.re" +#line 520 "../src/ast/lex.re" { return static_cast('-'); } -#line 2255 "src/ast/lex.cc" -yy403: +#line 2856 "src/ast/lex.cc" +yy471: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy404; - if (yych <= '7') goto yy428; -yy404: -#line 447 "../src/ast/lex.re" + if (yych <= '/') goto yy472; + if (yych <= '7') goto yy496; +yy472: +#line 506 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in octal escape sequence"); } -#line 2264 "src/ast/lex.cc" -yy405: +#line 2865 "src/ast/lex.cc" +yy473: ++YYCURSOR; - goto yy404; -yy406: + goto yy472; +yy474: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy407; - if (yych <= '9') goto yy430; + if (yych <= '/') goto yy475; + if (yych <= '9') goto yy498; } else { - if (yych <= 'F') goto yy430; - if (yych <= '`') goto yy407; - if (yych <= 'f') goto yy430; + if (yych <= 'F') goto yy498; + if (yych <= '`') goto yy475; + if (yych <= 'f') goto yy498; } -yy407: -#line 446 "../src/ast/lex.re" +yy475: +#line 505 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in hexadecimal escape sequence"); } -#line 2282 "src/ast/lex.cc" -yy408: +#line 2883 "src/ast/lex.cc" +yy476: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy407; - if (yych <= '9') goto yy431; - goto yy407; + if (yych <= '/') goto yy475; + if (yych <= '9') goto yy499; + goto yy475; } else { - if (yych <= 'F') goto yy431; - if (yych <= '`') goto yy407; - if (yych <= 'f') goto yy431; - goto yy407; + if (yych <= 'F') goto yy499; + if (yych <= '`') goto yy475; + if (yych <= 'f') goto yy499; + goto yy475; } -yy409: +yy477: ++YYCURSOR; -#line 460 "../src/ast/lex.re" +#line 519 "../src/ast/lex.re" { return static_cast('\\'); } -#line 2300 "src/ast/lex.cc" -yy411: +#line 2901 "src/ast/lex.cc" +yy479: ++YYCURSOR; -#line 462 "../src/ast/lex.re" +#line 521 "../src/ast/lex.re" { return static_cast(']'); } -#line 2305 "src/ast/lex.cc" -yy413: +#line 2906 "src/ast/lex.cc" +yy481: ++YYCURSOR; -#line 453 "../src/ast/lex.re" +#line 512 "../src/ast/lex.re" { return static_cast('\a'); } -#line 2310 "src/ast/lex.cc" -yy415: +#line 2911 "src/ast/lex.cc" +yy483: ++YYCURSOR; -#line 454 "../src/ast/lex.re" +#line 513 "../src/ast/lex.re" { return static_cast('\b'); } -#line 2315 "src/ast/lex.cc" -yy417: +#line 2916 "src/ast/lex.cc" +yy485: ++YYCURSOR; -#line 455 "../src/ast/lex.re" +#line 514 "../src/ast/lex.re" { return static_cast('\f'); } -#line 2320 "src/ast/lex.cc" -yy419: +#line 2921 "src/ast/lex.cc" +yy487: ++YYCURSOR; -#line 456 "../src/ast/lex.re" +#line 515 "../src/ast/lex.re" { return static_cast('\n'); } -#line 2325 "src/ast/lex.cc" -yy421: +#line 2926 "src/ast/lex.cc" +yy489: ++YYCURSOR; -#line 457 "../src/ast/lex.re" +#line 516 "../src/ast/lex.re" { return static_cast('\r'); } -#line 2330 "src/ast/lex.cc" -yy423: +#line 2931 "src/ast/lex.cc" +yy491: ++YYCURSOR; -#line 458 "../src/ast/lex.re" +#line 517 "../src/ast/lex.re" { return static_cast('\t'); } -#line 2335 "src/ast/lex.cc" -yy425: +#line 2936 "src/ast/lex.cc" +yy493: ++YYCURSOR; -#line 459 "../src/ast/lex.re" +#line 518 "../src/ast/lex.re" { return static_cast('\v'); } -#line 2340 "src/ast/lex.cc" -yy427: +#line 2941 "src/ast/lex.cc" +yy495: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy407; - if (yych <= '9') goto yy432; - goto yy407; + if (yych <= '/') goto yy475; + if (yych <= '9') goto yy500; + goto yy475; } else { - if (yych <= 'F') goto yy432; - if (yych <= '`') goto yy407; - if (yych <= 'f') goto yy432; - goto yy407; + if (yych <= 'F') goto yy500; + if (yych <= '`') goto yy475; + if (yych <= 'f') goto yy500; + goto yy475; } -yy428: +yy496: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '/') goto yy429; - if (yych <= '7') goto yy433; -yy429: + if (yych <= '/') goto yy497; + if (yych <= '7') goto yy501; +yy497: YYCURSOR = YYMARKER; if (yyaccept == 0) { - goto yy404; + goto yy472; } else { - goto yy407; + goto yy475; } -yy430: +yy498: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy429; - if (yych <= '9') goto yy435; - goto yy429; + if (yych <= '/') goto yy497; + if (yych <= '9') goto yy503; + goto yy497; } else { - if (yych <= 'F') goto yy435; - if (yych <= '`') goto yy429; - if (yych <= 'f') goto yy435; - goto yy429; + if (yych <= 'F') goto yy503; + if (yych <= '`') goto yy497; + if (yych <= 'f') goto yy503; + goto yy497; } -yy431: +yy499: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy429; - if (yych <= '9') goto yy436; - goto yy429; + if (yych <= '/') goto yy497; + if (yych <= '9') goto yy504; + goto yy497; } else { - if (yych <= 'F') goto yy436; - if (yych <= '`') goto yy429; - if (yych <= 'f') goto yy436; - goto yy429; + if (yych <= 'F') goto yy504; + if (yych <= '`') goto yy497; + if (yych <= 'f') goto yy504; + goto yy497; } -yy432: +yy500: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy429; - if (yych <= '9') goto yy437; - goto yy429; + if (yych <= '/') goto yy497; + if (yych <= '9') goto yy505; + goto yy497; } else { - if (yych <= 'F') goto yy437; - if (yych <= '`') goto yy429; - if (yych <= 'f') goto yy437; - goto yy429; + if (yych <= 'F') goto yy505; + if (yych <= '`') goto yy497; + if (yych <= 'f') goto yy505; + goto yy497; } -yy433: +yy501: ++YYCURSOR; -#line 452 "../src/ast/lex.re" +#line 511 "../src/ast/lex.re" { return unesc_oct(tok, cur); } -#line 2405 "src/ast/lex.cc" -yy435: +#line 3006 "src/ast/lex.cc" +yy503: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy429; - if (yych <= '9') goto yy439; - goto yy429; + if (yych <= '/') goto yy497; + if (yych <= '9') goto yy507; + goto yy497; } else { - if (yych <= 'F') goto yy439; - if (yych <= '`') goto yy429; - if (yych <= 'f') goto yy439; - goto yy429; + if (yych <= 'F') goto yy507; + if (yych <= '`') goto yy497; + if (yych <= 'f') goto yy507; + goto yy497; } -yy436: +yy504: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy429; - if (yych <= '9') goto yy432; - goto yy429; + if (yych <= '/') goto yy497; + if (yych <= '9') goto yy500; + goto yy497; } else { - if (yych <= 'F') goto yy432; - if (yych <= '`') goto yy429; - if (yych <= 'f') goto yy432; - goto yy429; + if (yych <= 'F') goto yy500; + if (yych <= '`') goto yy497; + if (yych <= 'f') goto yy500; + goto yy497; } -yy437: +yy505: ++YYCURSOR; -#line 451 "../src/ast/lex.re" +#line 510 "../src/ast/lex.re" { return unesc_hex(tok, cur); } -#line 2434 "src/ast/lex.cc" -yy439: +#line 3035 "src/ast/lex.cc" +yy507: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy429; - if (yych >= ':') goto yy429; + if (yych <= '/') goto yy497; + if (yych >= ':') goto yy497; } else { - if (yych <= 'F') goto yy440; - if (yych <= '`') goto yy429; - if (yych >= 'g') goto yy429; + if (yych <= 'F') goto yy508; + if (yych <= '`') goto yy497; + if (yych >= 'g') goto yy497; } -yy440: +yy508: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy429; - if (yych <= '9') goto yy431; - goto yy429; + if (yych <= '/') goto yy497; + if (yych <= '9') goto yy499; + goto yy497; } else { - if (yych <= 'F') goto yy431; - if (yych <= '`') goto yy429; - if (yych <= 'f') goto yy431; - goto yy429; + if (yych <= 'F') goto yy499; + if (yych <= '`') goto yy497; + if (yych <= 'f') goto yy499; + goto yy497; } } -#line 467 "../src/ast/lex.re" +#line 526 "../src/ast/lex.re" } @@ -2464,309 +3065,309 @@ uint32_t Scanner::lex_str_chr(char quote, bool &end) tok = cur; const uint32_t l = get_cline(), c = get_column(); -#line 2468 "src/ast/lex.cc" +#line 3069 "src/ast/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; if ((YYLIMIT - YYCURSOR) < 10) YYFILL(10); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\f') { - if (yych <= 0x00) goto yy443; - if (yych == '\n') goto yy447; - goto yy445; + if (yych <= 0x00) goto yy511; + if (yych == '\n') goto yy515; + goto yy513; } else { - if (yych <= '\r') goto yy449; - if (yych == '\\') goto yy450; - goto yy445; + if (yych <= '\r') goto yy517; + if (yych == '\\') goto yy518; + goto yy513; } -yy443: +yy511: ++YYCURSOR; -#line 477 "../src/ast/lex.re" +#line 536 "../src/ast/lex.re" { fail_if_eof(); return 0; } -#line 2487 "src/ast/lex.cc" -yy445: +#line 3088 "src/ast/lex.cc" +yy513: ++YYCURSOR; -yy446: -#line 483 "../src/ast/lex.re" +yy514: +#line 542 "../src/ast/lex.re" { end = tok[0] == quote; return static_cast(tok[0]); } -#line 2496 "src/ast/lex.cc" -yy447: +#line 3097 "src/ast/lex.cc" +yy515: ++YYCURSOR; -#line 478 "../src/ast/lex.re" +#line 537 "../src/ast/lex.re" { fatal_lc(l, c, "newline in character string"); } -#line 2501 "src/ast/lex.cc" -yy449: +#line 3102 "src/ast/lex.cc" +yy517: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy447; - goto yy446; -yy450: + if (yych == '\n') goto yy515; + goto yy514; +yy518: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '`') { if (yych <= '3') { if (yych <= '\n') { - if (yych <= 0x00) goto yy451; - if (yych <= '\t') goto yy452; - goto yy447; + if (yych <= 0x00) goto yy519; + if (yych <= '\t') goto yy520; + goto yy515; } else { - if (yych == '\r') goto yy454; - if (yych <= '/') goto yy452; - goto yy455; + if (yych == '\r') goto yy522; + if (yych <= '/') goto yy520; + goto yy523; } } else { if (yych <= 'W') { - if (yych <= '7') goto yy457; - if (yych == 'U') goto yy458; - goto yy452; + if (yych <= '7') goto yy525; + if (yych == 'U') goto yy526; + goto yy520; } else { - if (yych <= 'X') goto yy460; - if (yych == '\\') goto yy461; - goto yy452; + if (yych <= 'X') goto yy528; + if (yych == '\\') goto yy529; + goto yy520; } } } else { if (yych <= 'q') { if (yych <= 'e') { - if (yych <= 'a') goto yy463; - if (yych <= 'b') goto yy465; - goto yy452; + if (yych <= 'a') goto yy531; + if (yych <= 'b') goto yy533; + goto yy520; } else { - if (yych <= 'f') goto yy467; - if (yych == 'n') goto yy469; - goto yy452; + if (yych <= 'f') goto yy535; + if (yych == 'n') goto yy537; + goto yy520; } } else { if (yych <= 'u') { - if (yych <= 'r') goto yy471; - if (yych <= 's') goto yy452; - if (yych <= 't') goto yy473; - goto yy460; + if (yych <= 'r') goto yy539; + if (yych <= 's') goto yy520; + if (yych <= 't') goto yy541; + goto yy528; } else { - if (yych <= 'v') goto yy475; - if (yych == 'x') goto yy477; - goto yy452; + if (yych <= 'v') goto yy543; + if (yych == 'x') goto yy545; + goto yy520; } } } -yy451: -#line 481 "../src/ast/lex.re" +yy519: +#line 540 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in escape sequence"); } -#line 2557 "src/ast/lex.cc" -yy452: +#line 3158 "src/ast/lex.cc" +yy520: ++YYCURSOR; -yy453: -#line 497 "../src/ast/lex.re" +yy521: +#line 556 "../src/ast/lex.re" { if (tok[1] != quote) { warn.useless_escape(cline, get_column(), tok[1]); } return static_cast(tok[1]); } -#line 2568 "src/ast/lex.cc" -yy454: +#line 3169 "src/ast/lex.cc" +yy522: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy447; - goto yy453; -yy455: + if (yych == '\n') goto yy515; + goto yy521; +yy523: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy456; - if (yych <= '7') goto yy478; -yy456: -#line 480 "../src/ast/lex.re" + if (yych <= '/') goto yy524; + if (yych <= '7') goto yy546; +yy524: +#line 539 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in octal escape sequence"); } -#line 2581 "src/ast/lex.cc" -yy457: +#line 3182 "src/ast/lex.cc" +yy525: ++YYCURSOR; - goto yy456; -yy458: + goto yy524; +yy526: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy459; - if (yych <= '9') goto yy480; + if (yych <= '/') goto yy527; + if (yych <= '9') goto yy548; } else { - if (yych <= 'F') goto yy480; - if (yych <= '`') goto yy459; - if (yych <= 'f') goto yy480; + if (yych <= 'F') goto yy548; + if (yych <= '`') goto yy527; + if (yych <= 'f') goto yy548; } -yy459: -#line 479 "../src/ast/lex.re" +yy527: +#line 538 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in hexadecimal escape sequence"); } -#line 2599 "src/ast/lex.cc" -yy460: +#line 3200 "src/ast/lex.cc" +yy528: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy459; - if (yych <= '9') goto yy481; - goto yy459; + if (yych <= '/') goto yy527; + if (yych <= '9') goto yy549; + goto yy527; } else { - if (yych <= 'F') goto yy481; - if (yych <= '`') goto yy459; - if (yych <= 'f') goto yy481; - goto yy459; + if (yych <= 'F') goto yy549; + if (yych <= '`') goto yy527; + if (yych <= 'f') goto yy549; + goto yy527; } -yy461: +yy529: ++YYCURSOR; -#line 496 "../src/ast/lex.re" +#line 555 "../src/ast/lex.re" { return static_cast('\\'); } -#line 2617 "src/ast/lex.cc" -yy463: +#line 3218 "src/ast/lex.cc" +yy531: ++YYCURSOR; -#line 489 "../src/ast/lex.re" +#line 548 "../src/ast/lex.re" { return static_cast('\a'); } -#line 2622 "src/ast/lex.cc" -yy465: +#line 3223 "src/ast/lex.cc" +yy533: ++YYCURSOR; -#line 490 "../src/ast/lex.re" +#line 549 "../src/ast/lex.re" { return static_cast('\b'); } -#line 2627 "src/ast/lex.cc" -yy467: +#line 3228 "src/ast/lex.cc" +yy535: ++YYCURSOR; -#line 491 "../src/ast/lex.re" +#line 550 "../src/ast/lex.re" { return static_cast('\f'); } -#line 2632 "src/ast/lex.cc" -yy469: +#line 3233 "src/ast/lex.cc" +yy537: ++YYCURSOR; -#line 492 "../src/ast/lex.re" +#line 551 "../src/ast/lex.re" { return static_cast('\n'); } -#line 2637 "src/ast/lex.cc" -yy471: +#line 3238 "src/ast/lex.cc" +yy539: ++YYCURSOR; -#line 493 "../src/ast/lex.re" +#line 552 "../src/ast/lex.re" { return static_cast('\r'); } -#line 2642 "src/ast/lex.cc" -yy473: +#line 3243 "src/ast/lex.cc" +yy541: ++YYCURSOR; -#line 494 "../src/ast/lex.re" +#line 553 "../src/ast/lex.re" { return static_cast('\t'); } -#line 2647 "src/ast/lex.cc" -yy475: +#line 3248 "src/ast/lex.cc" +yy543: ++YYCURSOR; -#line 495 "../src/ast/lex.re" +#line 554 "../src/ast/lex.re" { return static_cast('\v'); } -#line 2652 "src/ast/lex.cc" -yy477: +#line 3253 "src/ast/lex.cc" +yy545: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy459; - if (yych <= '9') goto yy482; - goto yy459; + if (yych <= '/') goto yy527; + if (yych <= '9') goto yy550; + goto yy527; } else { - if (yych <= 'F') goto yy482; - if (yych <= '`') goto yy459; - if (yych <= 'f') goto yy482; - goto yy459; + if (yych <= 'F') goto yy550; + if (yych <= '`') goto yy527; + if (yych <= 'f') goto yy550; + goto yy527; } -yy478: +yy546: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '/') goto yy479; - if (yych <= '7') goto yy483; -yy479: + if (yych <= '/') goto yy547; + if (yych <= '7') goto yy551; +yy547: YYCURSOR = YYMARKER; if (yyaccept == 0) { - goto yy456; + goto yy524; } else { - goto yy459; + goto yy527; } -yy480: +yy548: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy479; - if (yych <= '9') goto yy485; - goto yy479; + if (yych <= '/') goto yy547; + if (yych <= '9') goto yy553; + goto yy547; } else { - if (yych <= 'F') goto yy485; - if (yych <= '`') goto yy479; - if (yych <= 'f') goto yy485; - goto yy479; + if (yych <= 'F') goto yy553; + if (yych <= '`') goto yy547; + if (yych <= 'f') goto yy553; + goto yy547; } -yy481: +yy549: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy479; - if (yych <= '9') goto yy486; - goto yy479; + if (yych <= '/') goto yy547; + if (yych <= '9') goto yy554; + goto yy547; } else { - if (yych <= 'F') goto yy486; - if (yych <= '`') goto yy479; - if (yych <= 'f') goto yy486; - goto yy479; + if (yych <= 'F') goto yy554; + if (yych <= '`') goto yy547; + if (yych <= 'f') goto yy554; + goto yy547; } -yy482: +yy550: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy479; - if (yych <= '9') goto yy487; - goto yy479; + if (yych <= '/') goto yy547; + if (yych <= '9') goto yy555; + goto yy547; } else { - if (yych <= 'F') goto yy487; - if (yych <= '`') goto yy479; - if (yych <= 'f') goto yy487; - goto yy479; + if (yych <= 'F') goto yy555; + if (yych <= '`') goto yy547; + if (yych <= 'f') goto yy555; + goto yy547; } -yy483: +yy551: ++YYCURSOR; -#line 488 "../src/ast/lex.re" +#line 547 "../src/ast/lex.re" { return unesc_oct(tok, cur); } -#line 2717 "src/ast/lex.cc" -yy485: +#line 3318 "src/ast/lex.cc" +yy553: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy479; - if (yych <= '9') goto yy489; - goto yy479; + if (yych <= '/') goto yy547; + if (yych <= '9') goto yy557; + goto yy547; } else { - if (yych <= 'F') goto yy489; - if (yych <= '`') goto yy479; - if (yych <= 'f') goto yy489; - goto yy479; + if (yych <= 'F') goto yy557; + if (yych <= '`') goto yy547; + if (yych <= 'f') goto yy557; + goto yy547; } -yy486: +yy554: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy479; - if (yych <= '9') goto yy482; - goto yy479; + if (yych <= '/') goto yy547; + if (yych <= '9') goto yy550; + goto yy547; } else { - if (yych <= 'F') goto yy482; - if (yych <= '`') goto yy479; - if (yych <= 'f') goto yy482; - goto yy479; + if (yych <= 'F') goto yy550; + if (yych <= '`') goto yy547; + if (yych <= 'f') goto yy550; + goto yy547; } -yy487: +yy555: ++YYCURSOR; -#line 487 "../src/ast/lex.re" +#line 546 "../src/ast/lex.re" { return unesc_hex(tok, cur); } -#line 2746 "src/ast/lex.cc" -yy489: +#line 3347 "src/ast/lex.cc" +yy557: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy479; - if (yych >= ':') goto yy479; + if (yych <= '/') goto yy547; + if (yych >= ':') goto yy547; } else { - if (yych <= 'F') goto yy490; - if (yych <= '`') goto yy479; - if (yych >= 'g') goto yy479; + if (yych <= 'F') goto yy558; + if (yych <= '`') goto yy547; + if (yych >= 'g') goto yy547; } -yy490: +yy558: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy479; - if (yych <= '9') goto yy481; - goto yy479; + if (yych <= '/') goto yy547; + if (yych <= '9') goto yy549; + goto yy547; } else { - if (yych <= 'F') goto yy481; - if (yych <= '`') goto yy479; - if (yych <= 'f') goto yy481; - goto yy479; + if (yych <= 'F') goto yy549; + if (yych <= '`') goto yy547; + if (yych <= 'f') goto yy549; + goto yy547; } } -#line 503 "../src/ast/lex.re" +#line 562 "../src/ast/lex.re" } @@ -2786,7 +3387,7 @@ void Scanner::set_sourceline () sourceline: tok = cur; -#line 2790 "src/ast/lex.cc" +#line 3391 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2827,100 +3428,100 @@ sourceline: yych = (YYCTYPE)*YYCURSOR; if (yych <= '\r') { if (yych <= '\t') { - if (yych >= 0x01) goto yy495; + if (yych >= 0x01) goto yy563; } else { - if (yych <= '\n') goto yy497; - if (yych <= '\f') goto yy495; - goto yy499; + if (yych <= '\n') goto yy565; + if (yych <= '\f') goto yy563; + goto yy567; } } else { if (yych <= '"') { - if (yych <= '!') goto yy495; - goto yy500; + if (yych <= '!') goto yy563; + goto yy568; } else { - if (yych <= '0') goto yy495; - if (yych <= '9') goto yy501; - goto yy495; + if (yych <= '0') goto yy563; + if (yych <= '9') goto yy569; + goto yy563; } } ++YYCURSOR; -#line 540 "../src/ast/lex.re" +#line 599 "../src/ast/lex.re" { --cur; tok = cur; return; } -#line 2854 "src/ast/lex.cc" -yy495: +#line 3455 "src/ast/lex.cc" +yy563: ++YYCURSOR; -yy496: -#line 546 "../src/ast/lex.re" +yy564: +#line 605 "../src/ast/lex.re" { goto sourceline; } -#line 2860 "src/ast/lex.cc" -yy497: +#line 3461 "src/ast/lex.cc" +yy565: ++YYCURSOR; -#line 535 "../src/ast/lex.re" +#line 594 "../src/ast/lex.re" { tok = cur; return; } -#line 2868 "src/ast/lex.cc" -yy499: +#line 3469 "src/ast/lex.cc" +yy567: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy497; - goto yy496; -yy500: + if (yych == '\n') goto yy565; + goto yy564; +yy568: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych <= 0x00) goto yy496; - if (yych == '\n') goto yy496; - goto yy505; -yy501: + if (yych <= 0x00) goto yy564; + if (yych == '\n') goto yy564; + goto yy573; +yy569: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 64) { - goto yy501; + goto yy569; } -#line 522 "../src/ast/lex.re" +#line 581 "../src/ast/lex.re" { if (!s_to_u32_unsafe (tok, cur, cline)) { fatal_lc(get_cline(), get_column(), "line number overflow"); } goto sourceline; } -#line 2892 "src/ast/lex.cc" -yy504: +#line 3493 "src/ast/lex.cc" +yy572: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy505: +yy573: if (yybm[0+yych] & 128) { - goto yy504; + goto yy572; } - if (yych <= '\n') goto yy506; - if (yych <= '"') goto yy507; - goto yy509; -yy506: + if (yych <= '\n') goto yy574; + if (yych <= '"') goto yy575; + goto yy577; +yy574: YYCURSOR = YYMARKER; - goto yy496; -yy507: + goto yy564; +yy575: ++YYCURSOR; -#line 529 "../src/ast/lex.re" +#line 588 "../src/ast/lex.re" { in.escaped_file_name = std::string (tok + 1, tok_len () - 2); // strip quotes strrreplace (in.escaped_file_name, "\\", "\\\\"); goto sourceline; } -#line 2915 "src/ast/lex.cc" -yy509: +#line 3516 "src/ast/lex.cc" +yy577: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x00) goto yy506; - if (yych == '\n') goto yy506; - goto yy504; + if (yych <= 0x00) goto yy574; + if (yych == '\n') goto yy574; + goto yy572; } -#line 547 "../src/ast/lex.re" +#line 606 "../src/ast/lex.re" } diff --git a/re2c/bootstrap/src/ast/parser.cc b/re2c/bootstrap/src/ast/parser.cc index 545a62e2..cfb91d62 100644 --- a/re2c/bootstrap/src/ast/parser.cc +++ b/re2c/bootstrap/src/ast/parser.cc @@ -131,14 +131,19 @@ extern int yydebug; # define YYTOKENTYPE enum yytokentype { - TOKEN_CLOSESIZE = 258, - TOKEN_CODE = 259, - TOKEN_CONF = 260, - TOKEN_ID = 261, - TOKEN_FID = 262, - TOKEN_FID_END = 263, - TOKEN_LINE_INFO = 264, - TOKEN_REGEXP = 265 + TOKEN_CJUMP = 258, + TOKEN_CNEXT = 259, + TOKEN_CLIST = 260, + TOKEN_CSETUP = 261, + TOKEN_CZERO = 262, + TOKEN_CLOSESIZE = 263, + TOKEN_CODE = 264, + TOKEN_CONF = 265, + TOKEN_ID = 266, + TOKEN_FID = 267, + TOKEN_FID_END = 268, + TOKEN_LINE_INFO = 269, + TOKEN_REGEXP = 270 }; #endif @@ -415,21 +420,21 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 70 +#define YYLAST 53 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 26 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 17 +#define YYNNTS 15 /* YYNRULES -- Number of rules. */ -#define YYNRULES 44 +#define YYNRULES 40 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 71 +#define YYNSTATES 57 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 265 +#define YYMAXUTOK 270 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -441,10 +446,10 @@ static const yytype_uint8 yytranslate[] = 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 17, 2, 2, 2, 2, 2, 2, - 24, 25, 14, 22, 19, 2, 2, 11, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 18, 13, - 15, 12, 16, 23, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 24, 25, 19, 22, 2, 2, 2, 16, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 18, + 2, 17, 2, 23, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21, 2, 2, 2, 2, 2, 2, 2, @@ -464,18 +469,19 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10 + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 67, 67, 69, 70, 71, 72, 76, 83, 89, - 92, 96, 96, 99, 103, 107, 114, 121, 128, 134, - 136, 142, 149, 150, 156, 162, 169, 171, 177, 181, - 188, 192, 199, 203, 210, 211, 217, 222, 223, 227, - 228, 229, 233, 234, 245 + 0, 72, 72, 74, 75, 76, 77, 81, 88, 94, + 97, 101, 101, 104, 108, 112, 119, 126, 133, 139, + 141, 147, 154, 156, 162, 166, 173, 177, 184, 188, + 195, 196, 202, 207, 208, 212, 213, 214, 218, 219, + 230 }; #endif @@ -484,13 +490,13 @@ static const yytype_uint8 yyrline[] = First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "TOKEN_CLOSESIZE", "TOKEN_CODE", - "TOKEN_CONF", "TOKEN_ID", "TOKEN_FID", "TOKEN_FID_END", - "TOKEN_LINE_INFO", "TOKEN_REGEXP", "'/'", "'='", "';'", "'*'", "'<'", - "'>'", "'!'", "':'", "','", "'|'", "'\\\\'", "'+'", "'?'", "'('", "')'", - "$accept", "spec", "def", "name", "enddef", "rule", "ccode", "clist", - "conds", "trailexpr", "expr", "diff", "term", "factor", "closes", - "close", "primary", YY_NULLPTR + "$end", "error", "$undefined", "TOKEN_CJUMP", "TOKEN_CNEXT", + "TOKEN_CLIST", "TOKEN_CSETUP", "TOKEN_CZERO", "TOKEN_CLOSESIZE", + "TOKEN_CODE", "TOKEN_CONF", "TOKEN_ID", "TOKEN_FID", "TOKEN_FID_END", + "TOKEN_LINE_INFO", "TOKEN_REGEXP", "'/'", "'='", "';'", "'*'", "'|'", + "'\\\\'", "'+'", "'?'", "'('", "')'", "$accept", "spec", "def", "name", + "enddef", "rule", "ccode", "trailexpr", "expr", "diff", "term", "factor", + "closes", "close", "primary", YY_NULLPTR }; #endif @@ -500,15 +506,15 @@ static const char *const yytname[] = static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 47, 61, 59, 42, 60, 62, 33, 58, 44, + 265, 266, 267, 268, 269, 270, 47, 61, 59, 42, 124, 92, 43, 63, 40, 41 }; # endif -#define YYPACT_NINF -45 +#define YYPACT_NINF -20 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-45))) + (!!((Yystate) == (-20))) #define YYTABLE_NINF -1 @@ -519,14 +525,12 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int8 yypact[] = { - -45, 0, -45, -45, 18, -45, -45, -45, 7, 22, - 19, -45, 19, -45, 41, 30, 10, -45, 19, -1, - -45, -45, -45, -45, 15, 28, 35, 34, -45, 27, - 24, -45, 19, 19, 19, -45, -45, -45, -45, -45, - 26, -45, -45, 38, 43, -45, 40, 2, 51, -45, - -45, -45, -45, -45, 39, 10, -45, -45, 52, 44, - 42, 15, 15, -45, 57, 56, -45, -45, -45, -45, - -45 + -20, 0, -20, -2, 14, 39, -20, 9, -20, -20, + -20, 25, 17, -20, 17, -20, 28, 19, 23, -20, + 17, 8, -20, 39, 39, -20, -20, 36, -20, -20, + -20, -20, -17, 20, -20, 17, 17, 17, -20, -20, + -20, -20, -20, 27, -20, -20, -20, -20, -20, -20, + -20, -20, -20, 31, 23, -20, -20 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -534,28 +538,26 @@ static const yytype_int8 yypact[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 2, 0, 1, 3, 43, 10, 6, 42, 0, 0, - 0, 4, 0, 5, 0, 26, 28, 30, 32, 34, - 9, 14, 24, 23, 0, 0, 0, 22, 43, 0, - 0, 13, 0, 0, 0, 33, 36, 39, 40, 41, - 35, 37, 19, 0, 0, 18, 0, 0, 0, 44, - 12, 8, 11, 7, 27, 29, 31, 38, 0, 0, - 0, 0, 0, 25, 0, 0, 17, 16, 15, 20, - 21 + 2, 0, 1, 0, 0, 0, 3, 39, 10, 6, + 38, 0, 0, 4, 0, 5, 0, 22, 24, 26, + 28, 30, 39, 0, 0, 17, 21, 0, 19, 18, + 9, 14, 0, 0, 13, 0, 0, 0, 29, 32, + 35, 36, 37, 31, 33, 16, 15, 20, 40, 12, + 8, 11, 7, 23, 25, 27, 34 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -45, -45, -45, -45, -45, -45, -44, 45, -45, 16, - -9, 31, -14, -45, -45, 25, -45 + -20, -20, -20, -20, -20, -20, -3, 26, -10, 11, + -19, -20, -20, 10, -20 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 1, 11, 12, 53, 13, 45, 26, 27, 14, - 15, 16, 17, 18, 40, 41, 19 + -1, 1, 13, 14, 52, 15, 29, 16, 17, 18, + 19, 20, 43, 44, 21 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -563,40 +565,34 @@ static const yytype_int8 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { - 2, 29, 36, 30, 35, 3, 4, 5, 28, 6, - 7, 21, 7, 37, 8, 9, 61, 67, 68, 42, - 56, 38, 39, 54, 10, 28, 10, 43, 22, 7, - 20, 34, 50, 44, 22, 51, 23, 52, 24, 25, - 37, 32, 23, 10, 33, 31, 66, 33, 38, 39, - 33, 47, 49, 48, 58, 59, 60, 63, 64, 33, - 65, 69, 70, 62, 55, 57, 0, 0, 0, 0, - 46 + 2, 38, 32, 36, 33, 3, 4, 5, 48, 22, + 6, 7, 8, 10, 9, 10, 39, 23, 55, 11, + 45, 46, 12, 25, 12, 53, 30, 40, 22, 24, + 41, 42, 10, 49, 31, 35, 50, 34, 51, 36, + 36, 12, 26, 27, 37, 47, 40, 54, 28, 41, + 42, 36, 0, 56 }; static const yytype_int8 yycheck[] = { - 0, 10, 3, 12, 18, 5, 6, 7, 6, 9, - 10, 4, 10, 14, 14, 15, 14, 61, 62, 4, - 34, 22, 23, 32, 24, 6, 24, 12, 6, 10, - 12, 21, 8, 18, 6, 11, 14, 13, 16, 17, - 14, 11, 14, 24, 20, 4, 4, 20, 22, 23, - 20, 16, 25, 19, 16, 12, 16, 6, 6, 20, - 16, 4, 6, 47, 33, 40, -1, -1, -1, -1, - 25 + 0, 20, 12, 20, 14, 5, 6, 7, 25, 11, + 10, 11, 12, 15, 14, 15, 8, 19, 37, 19, + 23, 24, 24, 9, 24, 35, 17, 19, 11, 3, + 22, 23, 15, 13, 9, 16, 16, 9, 18, 20, + 20, 24, 3, 4, 21, 9, 19, 36, 9, 22, + 23, 20, -1, 43 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 27, 0, 5, 6, 7, 9, 10, 14, 15, - 24, 28, 29, 31, 35, 36, 37, 38, 39, 42, - 12, 4, 6, 14, 16, 17, 33, 34, 6, 36, - 36, 4, 11, 20, 21, 38, 3, 14, 22, 23, - 40, 41, 4, 12, 18, 32, 33, 16, 19, 25, - 8, 11, 13, 30, 36, 37, 38, 41, 16, 12, - 16, 14, 35, 6, 6, 16, 4, 32, 32, 4, - 6 + 0, 27, 0, 5, 6, 7, 10, 11, 12, 14, + 15, 19, 24, 28, 29, 31, 33, 34, 35, 36, + 37, 40, 11, 19, 33, 9, 3, 4, 9, 32, + 17, 9, 34, 34, 9, 16, 20, 21, 36, 8, + 19, 22, 23, 38, 39, 32, 32, 9, 25, 13, + 16, 18, 30, 34, 35, 36, 39 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ @@ -605,18 +601,18 @@ static const yytype_uint8 yyr1[] = 0, 26, 27, 27, 27, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 31, 31, 31, 31, 32, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, - 37, 37, 38, 38, 39, 39, 39, 40, 40, 41, - 41, 41, 42, 42, 42 + 37, 37, 37, 38, 38, 39, 39, 39, 40, 40, + 40 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 2, 2, 2, 2, 3, 3, 2, - 1, 1, 1, 2, 2, 5, 5, 5, 3, 1, - 4, 4, 1, 1, 1, 3, 1, 3, 1, 3, - 1, 3, 1, 2, 1, 2, 2, 1, 2, 1, - 1, 1, 1, 1, 3 + 1, 1, 1, 2, 2, 3, 3, 2, 2, 1, + 2, 1, 1, 3, 1, 3, 1, 3, 1, 2, + 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, + 3 }; @@ -1355,10 +1351,10 @@ yyreduce: case 15: { - for(CondList::const_iterator i = (yyvsp[-3].clist)->begin(); i != (yyvsp[-3].clist)->end(); ++i) { + for(CondList::const_iterator i = (yyvsp[-2].clist)->begin(); i != (yyvsp[-2].clist)->end(); ++i) { find(context.specs, *i).rules.push_back(ASTRule((yyvsp[-1].regexp), (yyvsp[0].code))); } - delete (yyvsp[-3].clist); + delete (yyvsp[-2].clist); } break; @@ -1366,10 +1362,10 @@ yyreduce: case 16: { - for(CondList::const_iterator i = (yyvsp[-3].clist)->begin(); i != (yyvsp[-3].clist)->end(); ++i) { + for(CondList::const_iterator i = (yyvsp[-2].clist)->begin(); i != (yyvsp[-2].clist)->end(); ++i) { find(context.specs, *i).defs.push_back((yyvsp[0].code)); } - delete (yyvsp[-3].clist); + delete (yyvsp[-2].clist); } break; @@ -1377,10 +1373,10 @@ yyreduce: case 17: { - for (CondList::const_iterator i = (yyvsp[-2].clist)->begin(); i != (yyvsp[-2].clist)->end(); ++i) { + for (CondList::const_iterator i = (yyvsp[-1].clist)->begin(); i != (yyvsp[-1].clist)->end(); ++i) { find(context.specs, *i).setup.push_back((yyvsp[0].code)); } - delete (yyvsp[-2].clist); + delete (yyvsp[-1].clist); } break; @@ -1414,36 +1410,7 @@ yyreduce: break; - case 23: - - { - (yyval.clist) = new CondList; - (yyval.clist)->insert("*"); - } - - break; - - case 24: - - { - (yyval.clist) = new CondList; - (yyval.clist)->insert(*(yyvsp[0].str)); - delete (yyvsp[0].str); - } - - break; - - case 25: - - { - (yyvsp[-2].clist)->insert(*(yyvsp[0].str)); - delete (yyvsp[0].str); - (yyval.clist) = (yyvsp[-2].clist); - } - - break; - - case 26: + case 22: { (yyval.regexp) = ast_cap((yyvsp[0].regexp)); @@ -1451,7 +1418,7 @@ yyreduce: break; - case 27: + case 23: { (yyval.regexp) = ast_cat(ast_cap((yyvsp[-2].regexp)), @@ -1460,7 +1427,7 @@ yyreduce: break; - case 28: + case 24: { (yyval.regexp) = (yyvsp[0].regexp); @@ -1468,7 +1435,7 @@ yyreduce: break; - case 29: + case 25: { (yyval.regexp) = ast_alt((yyvsp[-2].regexp), (yyvsp[0].regexp)); @@ -1476,7 +1443,7 @@ yyreduce: break; - case 30: + case 26: { (yyval.regexp) = (yyvsp[0].regexp); @@ -1484,7 +1451,7 @@ yyreduce: break; - case 31: + case 27: { (yyval.regexp) = ast_diff((yyvsp[-2].regexp), (yyvsp[0].regexp)); @@ -1492,7 +1459,7 @@ yyreduce: break; - case 32: + case 28: { (yyval.regexp) = (yyvsp[0].regexp); @@ -1500,7 +1467,7 @@ yyreduce: break; - case 33: + case 29: { (yyval.regexp) = ast_cat((yyvsp[-1].regexp), (yyvsp[0].regexp)); @@ -1508,7 +1475,7 @@ yyreduce: break; - case 35: + case 31: { switch((yyvsp[0].op)) { @@ -1520,7 +1487,7 @@ yyreduce: break; - case 36: + case 32: { (yyval.regexp) = ast_iter((yyvsp[-1].regexp), (yyvsp[0].bounds).min, (yyvsp[0].bounds).max); @@ -1528,31 +1495,31 @@ yyreduce: break; - case 38: + case 34: { (yyval.op) = ((yyvsp[-1].op) == (yyvsp[0].op)) ? (yyvsp[-1].op) : '*'; } break; - case 39: + case 35: { (yyval.op) = '*'; } break; - case 40: + case 36: { (yyval.op) = '+'; } break; - case 41: + case 37: { (yyval.op) = '?'; } break; - case 43: + case 39: { symtab_t::iterator i = context.symtab.find(*(yyvsp[0].str)); @@ -1569,7 +1536,7 @@ yyreduce: break; - case 44: + case 40: { (yyval.regexp) = ast_cap((yyvsp[-1].regexp)); diff --git a/re2c/bootstrap/src/ast/y.tab.h b/re2c/bootstrap/src/ast/y.tab.h index 548d39d5..d9b15e5c 100644 --- a/re2c/bootstrap/src/ast/y.tab.h +++ b/re2c/bootstrap/src/ast/y.tab.h @@ -45,14 +45,19 @@ extern int yydebug; # define YYTOKENTYPE enum yytokentype { - TOKEN_CLOSESIZE = 258, - TOKEN_CODE = 259, - TOKEN_CONF = 260, - TOKEN_ID = 261, - TOKEN_FID = 262, - TOKEN_FID_END = 263, - TOKEN_LINE_INFO = 264, - TOKEN_REGEXP = 265 + TOKEN_CJUMP = 258, + TOKEN_CNEXT = 259, + TOKEN_CLIST = 260, + TOKEN_CSETUP = 261, + TOKEN_CZERO = 262, + TOKEN_CLOSESIZE = 263, + TOKEN_CODE = 264, + TOKEN_CONF = 265, + TOKEN_ID = 266, + TOKEN_FID = 267, + TOKEN_FID_END = 268, + TOKEN_LINE_INFO = 269, + TOKEN_REGEXP = 270 }; #endif diff --git a/re2c/src/ast/lex.re b/re2c/src/ast/lex.re index 2040f798..1e06b63c 100644 --- a/re2c/src/ast/lex.re +++ b/re2c/src/ast/lex.re @@ -196,9 +196,12 @@ scan: tchar = cur - pos; tok = cur; /*!re2c - "{" { lex_code_in_braces(); return TOKEN_CODE; } - ":=" { lex_code_indented(); return TOKEN_CODE; } - ":" / "=>" { return *tok; } + "{" { lex_code_in_braces(); return TOKEN_CODE; } + ":=" { lex_code_indented(); return TOKEN_CODE; } + + "=>" { lex_cgoto(); return TOKEN_CNEXT; } + ":=>" { lex_cgoto(); return TOKEN_CJUMP; } + "<" { return lex_clist(); } "//" { lex_cpp_comment(); goto scan; } "/*" { lex_c_comment(); goto scan; } @@ -216,7 +219,7 @@ scan: return TOKEN_REGEXP; } - [*+?<>!,()|=;/\\] { return *tok; } + [*+?()|;/\\=] { return *tok; } "{" [0-9]+ "}" { if (!s_to_u32_unsafe (tok + 1, cur - 1, yylval.bounds.min)) { @@ -261,30 +264,19 @@ scan: "re2c:" { return TOKEN_CONF; } - name / (space+ [^=>,]) { - yylval.str = new std::string (tok, tok_len ()); - if (globopts->FFlag) { - lexer_state = LEX_FLEX_NAME; - return TOKEN_FID; - } - else { + name { + if (!globopts->FFlag || lex_namedef_context_re2c()) { + yylval.str = new std::string (tok, tok_len()); return TOKEN_ID; } - } - - name / (space* [=>,]) { - yylval.str = new std::string (tok, tok_len ()); - return TOKEN_ID; - } - - name / [^] { - if (!globopts->FFlag) { + else if (lex_namedef_context_flex()) { yylval.str = new std::string (tok, tok_len()); - return TOKEN_ID; + lexer_state = LEX_FLEX_NAME; + return TOKEN_FID; } else { std::vector *str = new std::vector; - for (char *s = tok; s < cur; ++s) { + for (const char *s = tok; s < cur; ++s) { const uint32_t chr = static_cast(*s), col = static_cast(s - tok); @@ -326,6 +318,73 @@ scan: */ } +bool Scanner::lex_namedef_context_re2c() +{ +/*!re2c + "" / space* "=" [^>] { return true; } + "" { return false; } +*/ +} + +bool Scanner::lex_namedef_context_flex() +{ +/*!re2c + "" / space+ [=:{] { return false; } // exclude lookahead ("=" | "=>" | ":=>" | ":=" | "{") + "" / space+ { return true; } + "" { return false; } +*/ +} + +int Scanner::lex_clist() +{ + int kind = TOKEN_CLIST; + CondList *cl = NULL; +/*!re2c + space* "!" space* { kind = TOKEN_CSETUP; goto fst; } + space* ">" { kind = TOKEN_CZERO; goto end; } + space* { goto fst; } +*/ +fst: + cl = new CondList; + tok = cur; +/*!re2c + "*" space* ">" { cl->insert("*"); goto end; } + name { cl->insert(std::string(tok, tok_len())); goto sep; } + * { goto error; } +*/ +sep: +/*!re2c + space* "," space* { goto next; } + space* ">" { goto end; } + * { goto error; } +*/ +next: + tok = cur; +/*!re2c + name { cl->insert(std::string(tok, tok_len())); goto sep; } + * { goto error; } +*/ +end: + yylval.clist = cl; + return kind; +error: + delete cl; + fatal_l(get_cline(), "syntax error in condition list"); +} + +void Scanner::lex_cgoto() +{ +/*!re2c + space* { goto name; } +*/ +name: + tok = cur; +/*!re2c + name { yylval.str = new std::string (tok, tok_len ()); return; } + * { fatal_l(get_cline(), "syntax error in condition goto"); } +*/ +} + void Scanner::lex_code_indented() { const uint32_t line = cline; diff --git a/re2c/src/ast/parser.ypp b/re2c/src/ast/parser.ypp index 8e42eff9..87a606f2 100644 --- a/re2c/src/ast/parser.ypp +++ b/re2c/src/ast/parser.ypp @@ -46,6 +46,11 @@ static spec_t &find(specs_t &specs, const std::string &name) re2c::CondList * clist; }; +%token TOKEN_CJUMP +%token TOKEN_CNEXT +%token TOKEN_CLIST +%token TOKEN_CSETUP +%token TOKEN_CZERO %token TOKEN_CLOSESIZE %token TOKEN_CODE %token TOKEN_CONF @@ -59,8 +64,8 @@ static spec_t &find(specs_t &specs, const std::string &name) %type TOKEN_CLOSESIZE %type TOKEN_CODE ccode %type TOKEN_REGEXP trailexpr rule expr diff term factor primary -%type TOKEN_ID TOKEN_FID name -%type conds clist +%type TOKEN_CNEXT TOKEN_CJUMP TOKEN_ID TOKEN_FID name +%type TOKEN_CLIST TOKEN_CSETUP TOKEN_CZERO %% @@ -104,65 +109,45 @@ rule find(context.specs, "").defs.push_back($2); } - | '<' clist '>' trailexpr ccode { - for(CondList::const_iterator i = $2->begin(); i != $2->end(); ++i) { - find(context.specs, *i).rules.push_back(ASTRule($4, $5)); + | TOKEN_CLIST trailexpr ccode { + for(CondList::const_iterator i = $1->begin(); i != $1->end(); ++i) { + find(context.specs, *i).rules.push_back(ASTRule($2, $3)); } - delete $2; + delete $1; } - | '<' clist '>' '*' ccode { - for(CondList::const_iterator i = $2->begin(); i != $2->end(); ++i) { - find(context.specs, *i).defs.push_back($5); + | TOKEN_CLIST '*' ccode { + for(CondList::const_iterator i = $1->begin(); i != $1->end(); ++i) { + find(context.specs, *i).defs.push_back($3); } - delete $2; + delete $1; } - | '<' '!' clist '>' TOKEN_CODE { - for (CondList::const_iterator i = $3->begin(); i != $3->end(); ++i) { - find(context.specs, *i).setup.push_back($5); + | TOKEN_CSETUP TOKEN_CODE { + for (CondList::const_iterator i = $1->begin(); i != $1->end(); ++i) { + find(context.specs, *i).setup.push_back($2); } - delete $3; + delete $1; } - | '<' '>' ccode { + | TOKEN_CZERO ccode { const AST *r = ast_nil(context.input.get_cline(), 0); - find(context.specs, "0").rules.push_back(ASTRule(r, $3)); + find(context.specs, "0").rules.push_back(ASTRule(r, $2)); }; ccode : TOKEN_CODE - | '=' '>' TOKEN_ID TOKEN_CODE { - $$ = $4; - $$->cond = *$3; - delete $3; + | TOKEN_CNEXT TOKEN_CODE { + $$ = $2; + $$->cond = *$1; + delete $1; } - | ':' '=' '>' TOKEN_ID { + | TOKEN_CJUMP { $$ = new Code(context.input.get_fname(), context.input.get_cline()); - $$->cond = *$4; - delete $4; - }; - -clist - : conds - | '*' { - $$ = new CondList; - $$->insert("*"); - }; - -conds - : TOKEN_ID { - $$ = new CondList; - $$->insert(*$1); + $$->cond = *$1; delete $1; - } - - | conds ',' TOKEN_ID { - $1->insert(*$3); - delete $3; - $$ = $1; }; trailexpr diff --git a/re2c/src/ast/scanner.h b/re2c/src/ast/scanner.h index 3e81f8e8..239927e7 100644 --- a/re2c/src/ast/scanner.h +++ b/re2c/src/ast/scanner.h @@ -66,6 +66,10 @@ class Scanner: private ScannerState void lex_code_in_braces(); void lex_c_comment(); void lex_cpp_comment(); + bool lex_namedef_context_re2c(); + bool lex_namedef_context_flex(); + int lex_clist(); + void lex_cgoto(); void lex_string(char delim); void lex_tags(OutputFile &out, bool mtags); void set_sourceline (); diff --git a/re2c/test/cond_error_07.c.c b/re2c/test/cond_error_07.c.c index 90af544a..b0f2875d 100644 --- a/re2c/test/cond_error_07.c.c +++ b/re2c/test/cond_error_07.c.c @@ -1 +1 @@ -re2c: error: line 3: syntax error +re2c: error: line 3: syntax error in condition list diff --git a/re2c/test/cond_error_12.c.c b/re2c/test/cond_error_12.c.c index fb3f6752..b0f2875d 100644 --- a/re2c/test/cond_error_12.c.c +++ b/re2c/test/cond_error_12.c.c @@ -1 +1 @@ -re2c: error: line 3, column 3: unexpected character: '0' +re2c: error: line 3: syntax error in condition list diff --git a/re2c/test/flex_syntax/001a.i--flex-syntax.c b/re2c/test/flex_syntax/001a.i--flex-syntax.c new file mode 100644 index 00000000..2403569d --- /dev/null +++ b/re2c/test/flex_syntax/001a.i--flex-syntax.c @@ -0,0 +1,17 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/001a.i--flex-syntax.re b/re2c/test/flex_syntax/001a.i--flex-syntax.re new file mode 100644 index 00000000..72536bf7 --- /dev/null +++ b/re2c/test/flex_syntax/001a.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +a {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/001b.i--flex-syntax.c b/re2c/test/flex_syntax/001b.i--flex-syntax.c new file mode 100644 index 00000000..2403569d --- /dev/null +++ b/re2c/test/flex_syntax/001b.i--flex-syntax.c @@ -0,0 +1,17 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/001b.i--flex-syntax.re b/re2c/test/flex_syntax/001b.i--flex-syntax.re new file mode 100644 index 00000000..7da56168 --- /dev/null +++ b/re2c/test/flex_syntax/001b.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +"a" {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/001c.i--flex-syntax.c b/re2c/test/flex_syntax/001c.i--flex-syntax.c new file mode 100644 index 00000000..2403569d --- /dev/null +++ b/re2c/test/flex_syntax/001c.i--flex-syntax.c @@ -0,0 +1,17 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/001c.i--flex-syntax.re b/re2c/test/flex_syntax/001c.i--flex-syntax.re new file mode 100644 index 00000000..dbf3f524 --- /dev/null +++ b/re2c/test/flex_syntax/001c.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +(a) {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/002a.i--flex-syntax.c b/re2c/test/flex_syntax/002a.i--flex-syntax.c new file mode 100644 index 00000000..1e23355a --- /dev/null +++ b/re2c/test/flex_syntax/002a.i--flex-syntax.c @@ -0,0 +1,24 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/002a.i--flex-syntax.re b/re2c/test/flex_syntax/002a.i--flex-syntax.re new file mode 100644 index 00000000..30e71b43 --- /dev/null +++ b/re2c/test/flex_syntax/002a.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +ab {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/002b.i--flex-syntax.c b/re2c/test/flex_syntax/002b.i--flex-syntax.c new file mode 100644 index 00000000..1e23355a --- /dev/null +++ b/re2c/test/flex_syntax/002b.i--flex-syntax.c @@ -0,0 +1,24 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/002b.i--flex-syntax.re b/re2c/test/flex_syntax/002b.i--flex-syntax.re new file mode 100644 index 00000000..72db4bf4 --- /dev/null +++ b/re2c/test/flex_syntax/002b.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +"ab" {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/002c.i--flex-syntax.c b/re2c/test/flex_syntax/002c.i--flex-syntax.c new file mode 100644 index 00000000..1e23355a --- /dev/null +++ b/re2c/test/flex_syntax/002c.i--flex-syntax.c @@ -0,0 +1,24 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/002c.i--flex-syntax.re b/re2c/test/flex_syntax/002c.i--flex-syntax.re new file mode 100644 index 00000000..20d951b8 --- /dev/null +++ b/re2c/test/flex_syntax/002c.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +"a"b {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/002d.i--flex-syntax.c b/re2c/test/flex_syntax/002d.i--flex-syntax.c new file mode 100644 index 00000000..1e23355a --- /dev/null +++ b/re2c/test/flex_syntax/002d.i--flex-syntax.c @@ -0,0 +1,24 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/002d.i--flex-syntax.re b/re2c/test/flex_syntax/002d.i--flex-syntax.re new file mode 100644 index 00000000..7bb3fa50 --- /dev/null +++ b/re2c/test/flex_syntax/002d.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +a"b" {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/002e.i--flex-syntax.c b/re2c/test/flex_syntax/002e.i--flex-syntax.c new file mode 100644 index 00000000..1e23355a --- /dev/null +++ b/re2c/test/flex_syntax/002e.i--flex-syntax.c @@ -0,0 +1,24 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/002e.i--flex-syntax.re b/re2c/test/flex_syntax/002e.i--flex-syntax.re new file mode 100644 index 00000000..b50d170d --- /dev/null +++ b/re2c/test/flex_syntax/002e.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +"a""b" {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/002f.i--flex-syntax.c b/re2c/test/flex_syntax/002f.i--flex-syntax.c new file mode 100644 index 00000000..1e23355a --- /dev/null +++ b/re2c/test/flex_syntax/002f.i--flex-syntax.c @@ -0,0 +1,24 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/002f.i--flex-syntax.re b/re2c/test/flex_syntax/002f.i--flex-syntax.re new file mode 100644 index 00000000..3c002265 --- /dev/null +++ b/re2c/test/flex_syntax/002f.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +(ab) {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/002g.i--flex-syntax.c b/re2c/test/flex_syntax/002g.i--flex-syntax.c new file mode 100644 index 00000000..1e23355a --- /dev/null +++ b/re2c/test/flex_syntax/002g.i--flex-syntax.c @@ -0,0 +1,24 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/002g.i--flex-syntax.re b/re2c/test/flex_syntax/002g.i--flex-syntax.re new file mode 100644 index 00000000..5e20f8f2 --- /dev/null +++ b/re2c/test/flex_syntax/002g.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +(a)b {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/002h.i--flex-syntax.c b/re2c/test/flex_syntax/002h.i--flex-syntax.c new file mode 100644 index 00000000..1e23355a --- /dev/null +++ b/re2c/test/flex_syntax/002h.i--flex-syntax.c @@ -0,0 +1,24 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/002h.i--flex-syntax.re b/re2c/test/flex_syntax/002h.i--flex-syntax.re new file mode 100644 index 00000000..026cafef --- /dev/null +++ b/re2c/test/flex_syntax/002h.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +a(b) {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/002i.i--flex-syntax.c b/re2c/test/flex_syntax/002i.i--flex-syntax.c new file mode 100644 index 00000000..1e23355a --- /dev/null +++ b/re2c/test/flex_syntax/002i.i--flex-syntax.c @@ -0,0 +1,24 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/002i.i--flex-syntax.re b/re2c/test/flex_syntax/002i.i--flex-syntax.re new file mode 100644 index 00000000..47df5b47 --- /dev/null +++ b/re2c/test/flex_syntax/002i.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +(a)(b) {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/002j.i--flex-syntax.c b/re2c/test/flex_syntax/002j.i--flex-syntax.c new file mode 100644 index 00000000..1e23355a --- /dev/null +++ b/re2c/test/flex_syntax/002j.i--flex-syntax.c @@ -0,0 +1,24 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/002j.i--flex-syntax.re b/re2c/test/flex_syntax/002j.i--flex-syntax.re new file mode 100644 index 00000000..a12e52e3 --- /dev/null +++ b/re2c/test/flex_syntax/002j.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +"a" "b" {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/003a.i--flex-syntax.c b/re2c/test/flex_syntax/003a.i--flex-syntax.c new file mode 100644 index 00000000..d4643e8b --- /dev/null +++ b/re2c/test/flex_syntax/003a.i--flex-syntax.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + case 'b': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/003a.i--flex-syntax.re b/re2c/test/flex_syntax/003a.i--flex-syntax.re new file mode 100644 index 00000000..cac43ace --- /dev/null +++ b/re2c/test/flex_syntax/003a.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +a|b {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/003b.i--flex-syntax.c b/re2c/test/flex_syntax/003b.i--flex-syntax.c new file mode 100644 index 00000000..d4643e8b --- /dev/null +++ b/re2c/test/flex_syntax/003b.i--flex-syntax.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + case 'b': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/003b.i--flex-syntax.re b/re2c/test/flex_syntax/003b.i--flex-syntax.re new file mode 100644 index 00000000..dddc06f1 --- /dev/null +++ b/re2c/test/flex_syntax/003b.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +"a"|b {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/003c.i--flex-syntax.c b/re2c/test/flex_syntax/003c.i--flex-syntax.c new file mode 100644 index 00000000..d4643e8b --- /dev/null +++ b/re2c/test/flex_syntax/003c.i--flex-syntax.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + case 'b': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/003c.i--flex-syntax.re b/re2c/test/flex_syntax/003c.i--flex-syntax.re new file mode 100644 index 00000000..8b840fbd --- /dev/null +++ b/re2c/test/flex_syntax/003c.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +a|"b" {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/003d.i--flex-syntax.c b/re2c/test/flex_syntax/003d.i--flex-syntax.c new file mode 100644 index 00000000..d4643e8b --- /dev/null +++ b/re2c/test/flex_syntax/003d.i--flex-syntax.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + case 'b': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/003d.i--flex-syntax.re b/re2c/test/flex_syntax/003d.i--flex-syntax.re new file mode 100644 index 00000000..aea1b352 --- /dev/null +++ b/re2c/test/flex_syntax/003d.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +(a)|b {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/003e.i--flex-syntax.c b/re2c/test/flex_syntax/003e.i--flex-syntax.c new file mode 100644 index 00000000..d4643e8b --- /dev/null +++ b/re2c/test/flex_syntax/003e.i--flex-syntax.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + case 'b': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/003e.i--flex-syntax.re b/re2c/test/flex_syntax/003e.i--flex-syntax.re new file mode 100644 index 00000000..4bd091b1 --- /dev/null +++ b/re2c/test/flex_syntax/003e.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +a|(b) {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/003f.i--flex-syntax.c b/re2c/test/flex_syntax/003f.i--flex-syntax.c new file mode 100644 index 00000000..d4643e8b --- /dev/null +++ b/re2c/test/flex_syntax/003f.i--flex-syntax.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + case 'b': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/003f.i--flex-syntax.re b/re2c/test/flex_syntax/003f.i--flex-syntax.re new file mode 100644 index 00000000..0a05c139 --- /dev/null +++ b/re2c/test/flex_syntax/003f.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +(a)|(b) {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/004a.i--flex-syntax.c b/re2c/test/flex_syntax/004a.i--flex-syntax.c new file mode 100644 index 00000000..66d54458 --- /dev/null +++ b/re2c/test/flex_syntax/004a.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + {} +} +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/flex_syntax/004a.i--flex-syntax.re b/re2c/test/flex_syntax/004a.i--flex-syntax.re new file mode 100644 index 00000000..a2216ec3 --- /dev/null +++ b/re2c/test/flex_syntax/004a.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +a* {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/004b.i--flex-syntax.c b/re2c/test/flex_syntax/004b.i--flex-syntax.c new file mode 100644 index 00000000..66d54458 --- /dev/null +++ b/re2c/test/flex_syntax/004b.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + {} +} +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/flex_syntax/004b.i--flex-syntax.re b/re2c/test/flex_syntax/004b.i--flex-syntax.re new file mode 100644 index 00000000..6ee51e52 --- /dev/null +++ b/re2c/test/flex_syntax/004b.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +"a"* {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/004c.i--flex-syntax.c b/re2c/test/flex_syntax/004c.i--flex-syntax.c new file mode 100644 index 00000000..66d54458 --- /dev/null +++ b/re2c/test/flex_syntax/004c.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + {} +} +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/flex_syntax/004c.i--flex-syntax.re b/re2c/test/flex_syntax/004c.i--flex-syntax.re new file mode 100644 index 00000000..5809e04b --- /dev/null +++ b/re2c/test/flex_syntax/004c.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +[a]* {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/004d.i--flex-syntax.c b/re2c/test/flex_syntax/004d.i--flex-syntax.c new file mode 100644 index 00000000..66d54458 --- /dev/null +++ b/re2c/test/flex_syntax/004d.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + {} +} +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/flex_syntax/004d.i--flex-syntax.re b/re2c/test/flex_syntax/004d.i--flex-syntax.re new file mode 100644 index 00000000..31a37901 --- /dev/null +++ b/re2c/test/flex_syntax/004d.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +(a)* {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/005a.i--flex-syntax.c b/re2c/test/flex_syntax/005a.i--flex-syntax.c new file mode 100644 index 00000000..d1212d4e --- /dev/null +++ b/re2c/test/flex_syntax/005a.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + case 'c': goto yy5; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/005a.i--flex-syntax.re b/re2c/test/flex_syntax/005a.i--flex-syntax.re new file mode 100644 index 00000000..b361040e --- /dev/null +++ b/re2c/test/flex_syntax/005a.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +ab|c {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/005b.i--flex-syntax.c b/re2c/test/flex_syntax/005b.i--flex-syntax.c new file mode 100644 index 00000000..d1212d4e --- /dev/null +++ b/re2c/test/flex_syntax/005b.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + case 'c': goto yy5; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/005b.i--flex-syntax.re b/re2c/test/flex_syntax/005b.i--flex-syntax.re new file mode 100644 index 00000000..1a059ec0 --- /dev/null +++ b/re2c/test/flex_syntax/005b.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +"ab"|"c" {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/005c.i--flex-syntax.c b/re2c/test/flex_syntax/005c.i--flex-syntax.c new file mode 100644 index 00000000..d1212d4e --- /dev/null +++ b/re2c/test/flex_syntax/005c.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + case 'c': goto yy5; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/005c.i--flex-syntax.re b/re2c/test/flex_syntax/005c.i--flex-syntax.re new file mode 100644 index 00000000..fc48d127 --- /dev/null +++ b/re2c/test/flex_syntax/005c.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +"a"b|c {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/005d.i--flex-syntax.c b/re2c/test/flex_syntax/005d.i--flex-syntax.c new file mode 100644 index 00000000..d1212d4e --- /dev/null +++ b/re2c/test/flex_syntax/005d.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + case 'c': goto yy5; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/005d.i--flex-syntax.re b/re2c/test/flex_syntax/005d.i--flex-syntax.re new file mode 100644 index 00000000..352ba72e --- /dev/null +++ b/re2c/test/flex_syntax/005d.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +a"b"|c {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/005e.i--flex-syntax.c b/re2c/test/flex_syntax/005e.i--flex-syntax.c new file mode 100644 index 00000000..d1212d4e --- /dev/null +++ b/re2c/test/flex_syntax/005e.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + case 'c': goto yy5; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/005e.i--flex-syntax.re b/re2c/test/flex_syntax/005e.i--flex-syntax.re new file mode 100644 index 00000000..eb2885ef --- /dev/null +++ b/re2c/test/flex_syntax/005e.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +(a)b|c {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/005f.i--flex-syntax.c b/re2c/test/flex_syntax/005f.i--flex-syntax.c new file mode 100644 index 00000000..d1212d4e --- /dev/null +++ b/re2c/test/flex_syntax/005f.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + case 'c': goto yy5; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/005f.i--flex-syntax.re b/re2c/test/flex_syntax/005f.i--flex-syntax.re new file mode 100644 index 00000000..a45246f6 --- /dev/null +++ b/re2c/test/flex_syntax/005f.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +a(b)|c {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/005g.i--flex-syntax.c b/re2c/test/flex_syntax/005g.i--flex-syntax.c new file mode 100644 index 00000000..d1212d4e --- /dev/null +++ b/re2c/test/flex_syntax/005g.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + case 'c': goto yy5; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} diff --git a/re2c/test/flex_syntax/005g.i--flex-syntax.re b/re2c/test/flex_syntax/005g.i--flex-syntax.re new file mode 100644 index 00000000..7332010d --- /dev/null +++ b/re2c/test/flex_syntax/005g.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +(ab)|(c) {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/006a.i--flex-syntax.c b/re2c/test/flex_syntax/006a.i--flex-syntax.c new file mode 100644 index 00000000..b3d03144 --- /dev/null +++ b/re2c/test/flex_syntax/006a.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + case 'b': goto yy6; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + ++YYCURSOR; + {} +yy6: + yych = *++YYCURSOR; + switch (yych) { + case 'c': goto yy4; + default: goto yy3; + } +} diff --git a/re2c/test/flex_syntax/006a.i--flex-syntax.re b/re2c/test/flex_syntax/006a.i--flex-syntax.re new file mode 100644 index 00000000..1e17dfee --- /dev/null +++ b/re2c/test/flex_syntax/006a.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +a|bc {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/006b.i--flex-syntax.c b/re2c/test/flex_syntax/006b.i--flex-syntax.c new file mode 100644 index 00000000..b3d03144 --- /dev/null +++ b/re2c/test/flex_syntax/006b.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + case 'b': goto yy6; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + ++YYCURSOR; + {} +yy6: + yych = *++YYCURSOR; + switch (yych) { + case 'c': goto yy4; + default: goto yy3; + } +} diff --git a/re2c/test/flex_syntax/006b.i--flex-syntax.re b/re2c/test/flex_syntax/006b.i--flex-syntax.re new file mode 100644 index 00000000..2eece261 --- /dev/null +++ b/re2c/test/flex_syntax/006b.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +"a"|"bc" {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/006c.i--flex-syntax.c b/re2c/test/flex_syntax/006c.i--flex-syntax.c new file mode 100644 index 00000000..b3d03144 --- /dev/null +++ b/re2c/test/flex_syntax/006c.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + case 'b': goto yy6; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + ++YYCURSOR; + {} +yy6: + yych = *++YYCURSOR; + switch (yych) { + case 'c': goto yy4; + default: goto yy3; + } +} diff --git a/re2c/test/flex_syntax/006c.i--flex-syntax.re b/re2c/test/flex_syntax/006c.i--flex-syntax.re new file mode 100644 index 00000000..b864f0c2 --- /dev/null +++ b/re2c/test/flex_syntax/006c.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +a|"b"c {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/006d.i--flex-syntax.c b/re2c/test/flex_syntax/006d.i--flex-syntax.c new file mode 100644 index 00000000..b3d03144 --- /dev/null +++ b/re2c/test/flex_syntax/006d.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + case 'b': goto yy6; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + ++YYCURSOR; + {} +yy6: + yych = *++YYCURSOR; + switch (yych) { + case 'c': goto yy4; + default: goto yy3; + } +} diff --git a/re2c/test/flex_syntax/006d.i--flex-syntax.re b/re2c/test/flex_syntax/006d.i--flex-syntax.re new file mode 100644 index 00000000..19ba37ac --- /dev/null +++ b/re2c/test/flex_syntax/006d.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +a|b"c" {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/006e.i--flex-syntax.c b/re2c/test/flex_syntax/006e.i--flex-syntax.c new file mode 100644 index 00000000..b3d03144 --- /dev/null +++ b/re2c/test/flex_syntax/006e.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + case 'b': goto yy6; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + ++YYCURSOR; + {} +yy6: + yych = *++YYCURSOR; + switch (yych) { + case 'c': goto yy4; + default: goto yy3; + } +} diff --git a/re2c/test/flex_syntax/006e.i--flex-syntax.re b/re2c/test/flex_syntax/006e.i--flex-syntax.re new file mode 100644 index 00000000..b4d67575 --- /dev/null +++ b/re2c/test/flex_syntax/006e.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +(a)|(bc) {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/006f.i--flex-syntax.c b/re2c/test/flex_syntax/006f.i--flex-syntax.c new file mode 100644 index 00000000..b3d03144 --- /dev/null +++ b/re2c/test/flex_syntax/006f.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + case 'b': goto yy6; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + ++YYCURSOR; + {} +yy6: + yych = *++YYCURSOR; + switch (yych) { + case 'c': goto yy4; + default: goto yy3; + } +} diff --git a/re2c/test/flex_syntax/006f.i--flex-syntax.re b/re2c/test/flex_syntax/006f.i--flex-syntax.re new file mode 100644 index 00000000..6237376e --- /dev/null +++ b/re2c/test/flex_syntax/006f.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +a|(b)c {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/006g.i--flex-syntax.c b/re2c/test/flex_syntax/006g.i--flex-syntax.c new file mode 100644 index 00000000..b3d03144 --- /dev/null +++ b/re2c/test/flex_syntax/006g.i--flex-syntax.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + case 'b': goto yy6; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + ++YYCURSOR; + {} +yy6: + yych = *++YYCURSOR; + switch (yych) { + case 'c': goto yy4; + default: goto yy3; + } +} diff --git a/re2c/test/flex_syntax/006g.i--flex-syntax.re b/re2c/test/flex_syntax/006g.i--flex-syntax.re new file mode 100644 index 00000000..b2f926bd --- /dev/null +++ b/re2c/test/flex_syntax/006g.i--flex-syntax.re @@ -0,0 +1,4 @@ +%{ +a|b(c) {} + * {} +%} \ No newline at end of file diff --git a/re2c/test/flex_syntax/__patterns b/re2c/test/flex_syntax/__patterns new file mode 100644 index 00000000..7dcb07f5 --- /dev/null +++ b/re2c/test/flex_syntax/__patterns @@ -0,0 +1,43 @@ +001a a +001b "a" +001c (a) + +002a ab +002b "ab" +002c "a"b +002d a"b" +002e "a""b" +002f (ab) +002g (a)b +002h a(b) +002i (a)(b) +002j "a" "b" + +003a a|b +003b "a"|b +003c a|"b" +003d (a)|b +003e a|(b) +003f (a)|(b) + +004a a* +004b "a"* +004c [a]* +004d (a)* + +005a ab|c +005b "ab"|"c" +005c "a"b|c +005d a"b"|c +005e (a)b|c +005f a(b)|c +005g (ab)|(c) + +006a a|bc +006b "a"|"bc" +006c a|"b"c +006d a|b"c" +006e (a)|(bc) +006f a|(b)c +006g a|b(c) + diff --git a/re2c/test/flex_syntax/__run.sh b/re2c/test/flex_syntax/__run.sh new file mode 100755 index 00000000..7a94e676 --- /dev/null +++ b/re2c/test/flex_syntax/__run.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +test $# -ne 1 && { echo "usage: ./__run.sh "; exit 1; } +re2c="$1" + +while true; do + + f="" + while true; do + read l || { echo "all done!"; exit 0; } + + # empty line: end of group + test -z "$l" && break + + # test name followed by regexp + IFS=$'\t'; set $l; f="$1.i--flex-syntax"; r="$2" + + # generate .re files from __patterns file + printf "%%{\n$r {}\n * {}\n%%}" > $f.re + + # generate .c files from .re files + $re2c $f.re -Fi -W --no-generation-date --no-version -o$f.c 2>warnings \ + && cat warnings >> $f.c && rm warnings \ + || echo "failed on $f.re" + done + + # check that all .c files in the same group are equal + set `echo $f | grep -oE '^[0-9]+'`*.c + if [ $# -gt 1 ] ; then + x=$1; shift 1 + for y in $@; do + diff $x $y || { echo "failed on $x, $y"; exit 1; } + done + fi + +done < __patterns diff --git a/re2c/test/layout/000.i.c b/re2c/test/layout/000.i.c new file mode 100644 index 00000000..7187228e --- /dev/null +++ b/re2c/test/layout/000.i.c @@ -0,0 +1,51 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case '0': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case '1': goto yy5; + case '2': goto yy7; + case '3': goto yy9; + case '4': goto yy11; + case '5': goto yy13; + case '6': goto yy15; + case '7': goto yy17; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +yy7: + ++YYCURSOR; + {{{}}} +yy9: + ++YYCURSOR; + {"}"} +yy11: + ++YYCURSOR; + {'}'} +yy13: + ++YYCURSOR; + {/*}*/} +yy15: + ++YYCURSOR; + {/*} + */} +yy17: + ++YYCURSOR; + {//} + } +} + diff --git a/re2c/test/layout/000.i.re b/re2c/test/layout/000.i.re new file mode 100644 index 00000000..5705d631 --- /dev/null +++ b/re2c/test/layout/000.i.re @@ -0,0 +1,12 @@ +/*!re2c + "01" {} + "02" {{{}}} + "03" {"}"} + "04" {'}'} + "05" {/*}*/} + "06" {/*} + */} + "07" {//} + } + *{} +*/ diff --git a/re2c/test/layout/000_1.i.c b/re2c/test/layout/000_1.i.c new file mode 100644 index 00000000..7187228e --- /dev/null +++ b/re2c/test/layout/000_1.i.c @@ -0,0 +1,51 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case '0': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case '1': goto yy5; + case '2': goto yy7; + case '3': goto yy9; + case '4': goto yy11; + case '5': goto yy13; + case '6': goto yy15; + case '7': goto yy17; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +yy7: + ++YYCURSOR; + {{{}}} +yy9: + ++YYCURSOR; + {"}"} +yy11: + ++YYCURSOR; + {'}'} +yy13: + ++YYCURSOR; + {/*}*/} +yy15: + ++YYCURSOR; + {/*} + */} +yy17: + ++YYCURSOR; + {//} + } +} + diff --git a/re2c/test/layout/000_1.i.re b/re2c/test/layout/000_1.i.re new file mode 100644 index 00000000..5705d631 --- /dev/null +++ b/re2c/test/layout/000_1.i.re @@ -0,0 +1,12 @@ +/*!re2c + "01" {} + "02" {{{}}} + "03" {"}"} + "04" {'}'} + "05" {/*}*/} + "06" {/*} + */} + "07" {//} + } + *{} +*/ diff --git a/re2c/test/layout/000_2.ci.c b/re2c/test/layout/000_2.ci.c new file mode 100644 index 00000000..e4af1c9d --- /dev/null +++ b/re2c/test/layout/000_2.ci.c @@ -0,0 +1,193 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yyc0: goto yyc_0; + case yycx: goto yyc_x; + case yycy0: goto yyc_y0; + case yycz11: goto yyc_z11; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_0: + {} +/* *********************************** */ +yyc_x: + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case '0': goto yy8; + default: goto yy6; + } +yy6: + ++YYCURSOR; +yy7: + {} + {} +yy8: + yych = *++YYCURSOR; + switch (yych) { + case '1': goto yy9; + case '2': goto yy11; + case '3': goto yy13; + case '4': goto yy15; + case '5': goto yy17; + case '6': goto yy19; + case '7': goto yy21; + case '8': goto yy23; + case '9': goto yy25; + default: goto yy7; + } +yy9: + ++YYCURSOR; + {} + {} +yy11: + ++YYCURSOR; + {} + {} +yy13: + ++YYCURSOR; + {} + {} +yy15: + ++YYCURSOR; + {} + {} +yy17: + ++YYCURSOR; + {} + {} +yy19: + ++YYCURSOR; + {} + {} +yy21: + ++YYCURSOR; + {} + {} +yy23: + ++YYCURSOR; + {} + {} +yy25: + ++YYCURSOR; + {} + {} +/* *********************************** */ +yyc_y0: + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case '0': goto yy31; + default: goto yy29; + } +yy29: + ++YYCURSOR; +yy30: + {} + {} +yy31: + yych = *++YYCURSOR; + switch (yych) { + case '1': goto yy32; + case '2': goto yy34; + case '4': goto yy36; + case '5': goto yy38; + default: goto yy30; + } +yy32: + ++YYCURSOR; + {} + {} +yy34: + ++YYCURSOR; + {} + {} +yy36: + ++YYCURSOR; + {} + {} +yy38: + ++YYCURSOR; + {} + {} +/* *********************************** */ +yyc_z11: + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case '0': goto yy44; + default: goto yy42; + } +yy42: + ++YYCURSOR; +yy43: + {} + {} +yy44: + yych = *++YYCURSOR; + switch (yych) { + case '1': goto yy45; + case '2': goto yy47; + case '5': goto yy49; + default: goto yy43; + } +yy45: + ++YYCURSOR; + {} + {} +yy47: + ++YYCURSOR; + {} + {} +yy49: + ++YYCURSOR; + {} + {} +/* *********************************** */ +yyc_y: + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case '0': goto yy55; + default: goto yy53; + } +yy53: + ++YYCURSOR; +yy54: + {} + {} +yy55: + yych = *++YYCURSOR; + switch (yych) { + case '1': goto yy56; + case '2': goto yy58; + case '7': goto yy60; + case '8': goto yy62; + case '9': goto yy64; + default: goto yy54; + } +yy56: + ++YYCURSOR; + {} + {} +yy58: + ++YYCURSOR; + {} + {} +yy60: + ++YYCURSOR; + {} + {} +yy62: + ++YYCURSOR; + {} + {} +yy64: + ++YYCURSOR; + {} + {} +} + diff --git a/re2c/test/layout/000_2.ci.re b/re2c/test/layout/000_2.ci.re new file mode 100644 index 00000000..feaff519 --- /dev/null +++ b/re2c/test/layout/000_2.ci.re @@ -0,0 +1,16 @@ +/*!re2c + <*> "01" {} + < * > "02" {} + "03" {} + "04" {} + "05" {} + < x > "06" {} + "07" {} + "08" {} + "09" {} + {} + < ! y> {} + {} + <> {} + <*> * {} +*/ diff --git a/re2c/test/layout/001_01.i--flex-syntax.c b/re2c/test/layout/001_01.i--flex-syntax.c new file mode 100644 index 00000000..188476af --- /dev/null +++ b/re2c/test/layout/001_01.i--flex-syntax.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/layout/001_01.i--flex-syntax.re b/re2c/test/layout/001_01.i--flex-syntax.re new file mode 100644 index 00000000..5801d713 --- /dev/null +++ b/re2c/test/layout/001_01.i--flex-syntax.re @@ -0,0 +1,5 @@ +/*!re2c + a{} + *{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/001_02.i--flex-syntax.c b/re2c/test/layout/001_02.i--flex-syntax.c new file mode 100644 index 00000000..188476af --- /dev/null +++ b/re2c/test/layout/001_02.i--flex-syntax.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/layout/001_02.i--flex-syntax.re b/re2c/test/layout/001_02.i--flex-syntax.re new file mode 100644 index 00000000..16632626 --- /dev/null +++ b/re2c/test/layout/001_02.i--flex-syntax.re @@ -0,0 +1,5 @@ +/*!re2c +a {} +* { +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/001_03.i--flex-syntax.c b/re2c/test/layout/001_03.i--flex-syntax.c new file mode 100644 index 00000000..188476af --- /dev/null +++ b/re2c/test/layout/001_03.i--flex-syntax.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/layout/001_03.i--flex-syntax.re b/re2c/test/layout/001_03.i--flex-syntax.re new file mode 100644 index 00000000..ea8a34bf --- /dev/null +++ b/re2c/test/layout/001_03.i--flex-syntax.re @@ -0,0 +1,7 @@ +/*!re2c +a +{} +* +{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/001_04.i--flex-syntax.c b/re2c/test/layout/001_04.i--flex-syntax.c new file mode 100644 index 00000000..f1f529dd --- /dev/null +++ b/re2c/test/layout/001_04.i--flex-syntax.c @@ -0,0 +1,17 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy3; + default: goto yy2; + } +yy2: +yy3: + ++YYCURSOR; + ; + *:=; +} +re2c: warning: line 3: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/layout/001_04.i--flex-syntax.re b/re2c/test/layout/001_04.i--flex-syntax.re new file mode 100644 index 00000000..01e81aed --- /dev/null +++ b/re2c/test/layout/001_04.i--flex-syntax.re @@ -0,0 +1,4 @@ +/*!re2c + a:= ; + *:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/001_05.i--flex-syntax.c b/re2c/test/layout/001_05.i--flex-syntax.c new file mode 100644 index 00000000..85285a13 --- /dev/null +++ b/re2c/test/layout/001_05.i--flex-syntax.c @@ -0,0 +1,17 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; +yy4: + ++YYCURSOR; + ; +} diff --git a/re2c/test/layout/001_05.i--flex-syntax.re b/re2c/test/layout/001_05.i--flex-syntax.re new file mode 100644 index 00000000..b67bc2d4 --- /dev/null +++ b/re2c/test/layout/001_05.i--flex-syntax.re @@ -0,0 +1,4 @@ +/*!re2c +a :=; +* := ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/001_06.i--flex-syntax.c b/re2c/test/layout/001_06.i--flex-syntax.c new file mode 100644 index 00000000..52026ed5 --- /dev/null +++ b/re2c/test/layout/001_06.i--flex-syntax.c @@ -0,0 +1,19 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; + ; +yy4: + ++YYCURSOR; + ; + ; +} diff --git a/re2c/test/layout/001_06.i--flex-syntax.re b/re2c/test/layout/001_06.i--flex-syntax.re new file mode 100644 index 00000000..7c7158f5 --- /dev/null +++ b/re2c/test/layout/001_06.i--flex-syntax.re @@ -0,0 +1,6 @@ +/*!re2c +a := ; + ; +* := ; + ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/001_07.ci--flex-syntax.c b/re2c/test/layout/001_07.ci--flex-syntax.c new file mode 100644 index 00000000..c80c44ef --- /dev/null +++ b/re2c/test/layout/001_07.ci--flex-syntax.c @@ -0,0 +1,28 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + {} +} diff --git a/re2c/test/layout/001_07.ci--flex-syntax.re b/re2c/test/layout/001_07.ci--flex-syntax.re new file mode 100644 index 00000000..c47a131c --- /dev/null +++ b/re2c/test/layout/001_07.ci--flex-syntax.re @@ -0,0 +1,4 @@ +/*!re2c + a {} +< y,x>*{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/001_08.ci--flex-syntax.c b/re2c/test/layout/001_08.ci--flex-syntax.c new file mode 100644 index 00000000..3e4d06fc --- /dev/null +++ b/re2c/test/layout/001_08.ci--flex-syntax.c @@ -0,0 +1,28 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + ; +} diff --git a/re2c/test/layout/001_08.ci--flex-syntax.re b/re2c/test/layout/001_08.ci--flex-syntax.re new file mode 100644 index 00000000..6dc264e9 --- /dev/null +++ b/re2c/test/layout/001_08.ci--flex-syntax.re @@ -0,0 +1,4 @@ +/*!re2c + a := ; +*:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/001_09.ci--flex-syntax.c b/re2c/test/layout/001_09.ci--flex-syntax.c new file mode 100644 index 00000000..74ec3da2 --- /dev/null +++ b/re2c/test/layout/001_09.ci--flex-syntax.c @@ -0,0 +1,30 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + YYSETCONDITION(yycz); + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + {} +} diff --git a/re2c/test/layout/001_09.ci--flex-syntax.re b/re2c/test/layout/001_09.ci--flex-syntax.re new file mode 100644 index 00000000..9a68652e --- /dev/null +++ b/re2c/test/layout/001_09.ci--flex-syntax.re @@ -0,0 +1,4 @@ +/*!re2c + a => z {} +*=>x{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/001_10.ci--flex-syntax.c b/re2c/test/layout/001_10.ci--flex-syntax.c new file mode 100644 index 00000000..6664b89e --- /dev/null +++ b/re2c/test/layout/001_10.ci--flex-syntax.c @@ -0,0 +1,30 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + YYSETCONDITION(yycz); + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + ; +} diff --git a/re2c/test/layout/001_10.ci--flex-syntax.re b/re2c/test/layout/001_10.ci--flex-syntax.re new file mode 100644 index 00000000..9996d8a7 --- /dev/null +++ b/re2c/test/layout/001_10.ci--flex-syntax.re @@ -0,0 +1,4 @@ +/*!re2c + a => z := ; +*=>x:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/002_01.i.c b/re2c/test/layout/002_01.i.c new file mode 100644 index 00000000..188476af --- /dev/null +++ b/re2c/test/layout/002_01.i.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/layout/002_01.i.re b/re2c/test/layout/002_01.i.re new file mode 100644 index 00000000..269ce10c --- /dev/null +++ b/re2c/test/layout/002_01.i.re @@ -0,0 +1,5 @@ +/*!re2c + "a"{} + *{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/002_02.i.c b/re2c/test/layout/002_02.i.c new file mode 100644 index 00000000..188476af --- /dev/null +++ b/re2c/test/layout/002_02.i.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/layout/002_02.i.re b/re2c/test/layout/002_02.i.re new file mode 100644 index 00000000..33c25a15 --- /dev/null +++ b/re2c/test/layout/002_02.i.re @@ -0,0 +1,5 @@ +/*!re2c +"a" {} +* { +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/002_03.i.c b/re2c/test/layout/002_03.i.c new file mode 100644 index 00000000..188476af --- /dev/null +++ b/re2c/test/layout/002_03.i.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/layout/002_03.i.re b/re2c/test/layout/002_03.i.re new file mode 100644 index 00000000..a9eac07c --- /dev/null +++ b/re2c/test/layout/002_03.i.re @@ -0,0 +1,7 @@ +/*!re2c +"a" +{} +* +{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/002_04.i.c b/re2c/test/layout/002_04.i.c new file mode 100644 index 00000000..f1f529dd --- /dev/null +++ b/re2c/test/layout/002_04.i.c @@ -0,0 +1,17 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy3; + default: goto yy2; + } +yy2: +yy3: + ++YYCURSOR; + ; + *:=; +} +re2c: warning: line 3: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/layout/002_04.i.re b/re2c/test/layout/002_04.i.re new file mode 100644 index 00000000..82eb7063 --- /dev/null +++ b/re2c/test/layout/002_04.i.re @@ -0,0 +1,4 @@ +/*!re2c + "a":= ; + *:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/002_05.i.c b/re2c/test/layout/002_05.i.c new file mode 100644 index 00000000..85285a13 --- /dev/null +++ b/re2c/test/layout/002_05.i.c @@ -0,0 +1,17 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; +yy4: + ++YYCURSOR; + ; +} diff --git a/re2c/test/layout/002_05.i.re b/re2c/test/layout/002_05.i.re new file mode 100644 index 00000000..e9841812 --- /dev/null +++ b/re2c/test/layout/002_05.i.re @@ -0,0 +1,4 @@ +/*!re2c +"a" :=; +* := ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/002_06.i.c b/re2c/test/layout/002_06.i.c new file mode 100644 index 00000000..52026ed5 --- /dev/null +++ b/re2c/test/layout/002_06.i.c @@ -0,0 +1,19 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; + ; +yy4: + ++YYCURSOR; + ; + ; +} diff --git a/re2c/test/layout/002_06.i.re b/re2c/test/layout/002_06.i.re new file mode 100644 index 00000000..cec3f721 --- /dev/null +++ b/re2c/test/layout/002_06.i.re @@ -0,0 +1,6 @@ +/*!re2c +"a" := ; + ; +* := ; + ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/002_07.ci.c b/re2c/test/layout/002_07.ci.c new file mode 100644 index 00000000..c80c44ef --- /dev/null +++ b/re2c/test/layout/002_07.ci.c @@ -0,0 +1,28 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + {} +} diff --git a/re2c/test/layout/002_07.ci.re b/re2c/test/layout/002_07.ci.re new file mode 100644 index 00000000..8f6ba832 --- /dev/null +++ b/re2c/test/layout/002_07.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a" {} +< y,x>*{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/002_08.ci.c b/re2c/test/layout/002_08.ci.c new file mode 100644 index 00000000..3e4d06fc --- /dev/null +++ b/re2c/test/layout/002_08.ci.c @@ -0,0 +1,28 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + ; +} diff --git a/re2c/test/layout/002_08.ci.re b/re2c/test/layout/002_08.ci.re new file mode 100644 index 00000000..6fce8a3d --- /dev/null +++ b/re2c/test/layout/002_08.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a" := ; +*:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/002_09.ci.c b/re2c/test/layout/002_09.ci.c new file mode 100644 index 00000000..74ec3da2 --- /dev/null +++ b/re2c/test/layout/002_09.ci.c @@ -0,0 +1,30 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + YYSETCONDITION(yycz); + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + {} +} diff --git a/re2c/test/layout/002_09.ci.re b/re2c/test/layout/002_09.ci.re new file mode 100644 index 00000000..3f6335c3 --- /dev/null +++ b/re2c/test/layout/002_09.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a" => z {} +*=>x{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/002_10.ci.c b/re2c/test/layout/002_10.ci.c new file mode 100644 index 00000000..6664b89e --- /dev/null +++ b/re2c/test/layout/002_10.ci.c @@ -0,0 +1,30 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + YYSETCONDITION(yycz); + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + ; +} diff --git a/re2c/test/layout/002_10.ci.re b/re2c/test/layout/002_10.ci.re new file mode 100644 index 00000000..6512ebc6 --- /dev/null +++ b/re2c/test/layout/002_10.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a" => z := ; +*=>x:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/003_01.i.c b/re2c/test/layout/003_01.i.c new file mode 100644 index 00000000..188476af --- /dev/null +++ b/re2c/test/layout/003_01.i.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/layout/003_01.i.re b/re2c/test/layout/003_01.i.re new file mode 100644 index 00000000..ae0c8929 --- /dev/null +++ b/re2c/test/layout/003_01.i.re @@ -0,0 +1,5 @@ +/*!re2c + ("a"){} + *{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/003_02.i.c b/re2c/test/layout/003_02.i.c new file mode 100644 index 00000000..188476af --- /dev/null +++ b/re2c/test/layout/003_02.i.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/layout/003_02.i.re b/re2c/test/layout/003_02.i.re new file mode 100644 index 00000000..da3cea75 --- /dev/null +++ b/re2c/test/layout/003_02.i.re @@ -0,0 +1,5 @@ +/*!re2c +("a") {} +* { +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/003_03.i.c b/re2c/test/layout/003_03.i.c new file mode 100644 index 00000000..188476af --- /dev/null +++ b/re2c/test/layout/003_03.i.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/layout/003_03.i.re b/re2c/test/layout/003_03.i.re new file mode 100644 index 00000000..1d07c2c1 --- /dev/null +++ b/re2c/test/layout/003_03.i.re @@ -0,0 +1,7 @@ +/*!re2c +("a") +{} +* +{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/003_04.i.c b/re2c/test/layout/003_04.i.c new file mode 100644 index 00000000..f1f529dd --- /dev/null +++ b/re2c/test/layout/003_04.i.c @@ -0,0 +1,17 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy3; + default: goto yy2; + } +yy2: +yy3: + ++YYCURSOR; + ; + *:=; +} +re2c: warning: line 3: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/layout/003_04.i.re b/re2c/test/layout/003_04.i.re new file mode 100644 index 00000000..f9b439e4 --- /dev/null +++ b/re2c/test/layout/003_04.i.re @@ -0,0 +1,4 @@ +/*!re2c + ("a"):= ; + *:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/003_05.i.c b/re2c/test/layout/003_05.i.c new file mode 100644 index 00000000..85285a13 --- /dev/null +++ b/re2c/test/layout/003_05.i.c @@ -0,0 +1,17 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; +yy4: + ++YYCURSOR; + ; +} diff --git a/re2c/test/layout/003_05.i.re b/re2c/test/layout/003_05.i.re new file mode 100644 index 00000000..f429b9b2 --- /dev/null +++ b/re2c/test/layout/003_05.i.re @@ -0,0 +1,4 @@ +/*!re2c +("a") :=; +* := ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/003_06.i.c b/re2c/test/layout/003_06.i.c new file mode 100644 index 00000000..52026ed5 --- /dev/null +++ b/re2c/test/layout/003_06.i.c @@ -0,0 +1,19 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; + ; +yy4: + ++YYCURSOR; + ; + ; +} diff --git a/re2c/test/layout/003_06.i.re b/re2c/test/layout/003_06.i.re new file mode 100644 index 00000000..2438f9f6 --- /dev/null +++ b/re2c/test/layout/003_06.i.re @@ -0,0 +1,6 @@ +/*!re2c +("a") := ; + ; +* := ; + ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/003_07.ci.c b/re2c/test/layout/003_07.ci.c new file mode 100644 index 00000000..c80c44ef --- /dev/null +++ b/re2c/test/layout/003_07.ci.c @@ -0,0 +1,28 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + {} +} diff --git a/re2c/test/layout/003_07.ci.re b/re2c/test/layout/003_07.ci.re new file mode 100644 index 00000000..ea2a71f6 --- /dev/null +++ b/re2c/test/layout/003_07.ci.re @@ -0,0 +1,4 @@ +/*!re2c + ("a") {} +< y,x>*{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/003_08.ci.c b/re2c/test/layout/003_08.ci.c new file mode 100644 index 00000000..3e4d06fc --- /dev/null +++ b/re2c/test/layout/003_08.ci.c @@ -0,0 +1,28 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + ; +} diff --git a/re2c/test/layout/003_08.ci.re b/re2c/test/layout/003_08.ci.re new file mode 100644 index 00000000..868707e1 --- /dev/null +++ b/re2c/test/layout/003_08.ci.re @@ -0,0 +1,4 @@ +/*!re2c + ("a") := ; +*:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/003_09.ci.c b/re2c/test/layout/003_09.ci.c new file mode 100644 index 00000000..74ec3da2 --- /dev/null +++ b/re2c/test/layout/003_09.ci.c @@ -0,0 +1,30 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + YYSETCONDITION(yycz); + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + {} +} diff --git a/re2c/test/layout/003_09.ci.re b/re2c/test/layout/003_09.ci.re new file mode 100644 index 00000000..5ee7e3b5 --- /dev/null +++ b/re2c/test/layout/003_09.ci.re @@ -0,0 +1,4 @@ +/*!re2c + ("a") => z {} +*=>x{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/003_10.ci.c b/re2c/test/layout/003_10.ci.c new file mode 100644 index 00000000..6664b89e --- /dev/null +++ b/re2c/test/layout/003_10.ci.c @@ -0,0 +1,30 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + YYSETCONDITION(yycz); + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + ; +} diff --git a/re2c/test/layout/003_10.ci.re b/re2c/test/layout/003_10.ci.re new file mode 100644 index 00000000..2b252a90 --- /dev/null +++ b/re2c/test/layout/003_10.ci.re @@ -0,0 +1,4 @@ +/*!re2c + ("a") => z := ; +*=>x:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/004_01.i--posix-captures.c b/re2c/test/layout/004_01.i--posix-captures.c new file mode 100644 index 00000000..a30bf3dd --- /dev/null +++ b/re2c/test/layout/004_01.i--posix-captures.c @@ -0,0 +1,23 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + yynmatch = 2; + yypmatch[0] = YYCURSOR - 1; + yypmatch[1] = YYCURSOR; + yypmatch[2] = YYCURSOR - 1; + yypmatch[3] = YYCURSOR; + {} +} diff --git a/re2c/test/layout/004_01.i--posix-captures.re b/re2c/test/layout/004_01.i--posix-captures.re new file mode 100644 index 00000000..ae0c8929 --- /dev/null +++ b/re2c/test/layout/004_01.i--posix-captures.re @@ -0,0 +1,5 @@ +/*!re2c + ("a"){} + *{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/004_02.i--posix-captures.c b/re2c/test/layout/004_02.i--posix-captures.c new file mode 100644 index 00000000..a30bf3dd --- /dev/null +++ b/re2c/test/layout/004_02.i--posix-captures.c @@ -0,0 +1,23 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + yynmatch = 2; + yypmatch[0] = YYCURSOR - 1; + yypmatch[1] = YYCURSOR; + yypmatch[2] = YYCURSOR - 1; + yypmatch[3] = YYCURSOR; + {} +} diff --git a/re2c/test/layout/004_02.i--posix-captures.re b/re2c/test/layout/004_02.i--posix-captures.re new file mode 100644 index 00000000..da3cea75 --- /dev/null +++ b/re2c/test/layout/004_02.i--posix-captures.re @@ -0,0 +1,5 @@ +/*!re2c +("a") {} +* { +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/004_03.i--posix-captures.c b/re2c/test/layout/004_03.i--posix-captures.c new file mode 100644 index 00000000..a30bf3dd --- /dev/null +++ b/re2c/test/layout/004_03.i--posix-captures.c @@ -0,0 +1,23 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + yynmatch = 2; + yypmatch[0] = YYCURSOR - 1; + yypmatch[1] = YYCURSOR; + yypmatch[2] = YYCURSOR - 1; + yypmatch[3] = YYCURSOR; + {} +} diff --git a/re2c/test/layout/004_03.i--posix-captures.re b/re2c/test/layout/004_03.i--posix-captures.re new file mode 100644 index 00000000..1d07c2c1 --- /dev/null +++ b/re2c/test/layout/004_03.i--posix-captures.re @@ -0,0 +1,7 @@ +/*!re2c +("a") +{} +* +{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/004_04.i--posix-captures.c b/re2c/test/layout/004_04.i--posix-captures.c new file mode 100644 index 00000000..35fecfd1 --- /dev/null +++ b/re2c/test/layout/004_04.i--posix-captures.c @@ -0,0 +1,22 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy3; + default: goto yy2; + } +yy2: +yy3: + ++YYCURSOR; + yynmatch = 2; + yypmatch[0] = YYCURSOR - 1; + yypmatch[1] = YYCURSOR; + yypmatch[2] = YYCURSOR - 1; + yypmatch[3] = YYCURSOR; + ; + *:=; +} +re2c: warning: line 3: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/layout/004_04.i--posix-captures.re b/re2c/test/layout/004_04.i--posix-captures.re new file mode 100644 index 00000000..f9b439e4 --- /dev/null +++ b/re2c/test/layout/004_04.i--posix-captures.re @@ -0,0 +1,4 @@ +/*!re2c + ("a"):= ; + *:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/004_05.i--posix-captures.c b/re2c/test/layout/004_05.i--posix-captures.c new file mode 100644 index 00000000..6fb5ce1c --- /dev/null +++ b/re2c/test/layout/004_05.i--posix-captures.c @@ -0,0 +1,22 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; +yy4: + ++YYCURSOR; + yynmatch = 2; + yypmatch[0] = YYCURSOR - 1; + yypmatch[1] = YYCURSOR; + yypmatch[2] = YYCURSOR - 1; + yypmatch[3] = YYCURSOR; + ; +} diff --git a/re2c/test/layout/004_05.i--posix-captures.re b/re2c/test/layout/004_05.i--posix-captures.re new file mode 100644 index 00000000..f429b9b2 --- /dev/null +++ b/re2c/test/layout/004_05.i--posix-captures.re @@ -0,0 +1,4 @@ +/*!re2c +("a") :=; +* := ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/004_06.i--posix-captures.c b/re2c/test/layout/004_06.i--posix-captures.c new file mode 100644 index 00000000..83c63edf --- /dev/null +++ b/re2c/test/layout/004_06.i--posix-captures.c @@ -0,0 +1,24 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; + ; +yy4: + ++YYCURSOR; + yynmatch = 2; + yypmatch[0] = YYCURSOR - 1; + yypmatch[1] = YYCURSOR; + yypmatch[2] = YYCURSOR - 1; + yypmatch[3] = YYCURSOR; + ; + ; +} diff --git a/re2c/test/layout/004_06.i--posix-captures.re b/re2c/test/layout/004_06.i--posix-captures.re new file mode 100644 index 00000000..2438f9f6 --- /dev/null +++ b/re2c/test/layout/004_06.i--posix-captures.re @@ -0,0 +1,6 @@ +/*!re2c +("a") := ; + ; +* := ; + ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/004_07.ci--posix-captures.c b/re2c/test/layout/004_07.ci--posix-captures.c new file mode 100644 index 00000000..8ec227ad --- /dev/null +++ b/re2c/test/layout/004_07.ci--posix-captures.c @@ -0,0 +1,33 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + yynmatch = 2; + yypmatch[0] = YYCURSOR - 1; + yypmatch[1] = YYCURSOR; + yypmatch[2] = YYCURSOR - 1; + yypmatch[3] = YYCURSOR; + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + {} +} diff --git a/re2c/test/layout/004_07.ci--posix-captures.re b/re2c/test/layout/004_07.ci--posix-captures.re new file mode 100644 index 00000000..ea2a71f6 --- /dev/null +++ b/re2c/test/layout/004_07.ci--posix-captures.re @@ -0,0 +1,4 @@ +/*!re2c + ("a") {} +< y,x>*{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/004_08.ci--posix-captures.c b/re2c/test/layout/004_08.ci--posix-captures.c new file mode 100644 index 00000000..62d59abd --- /dev/null +++ b/re2c/test/layout/004_08.ci--posix-captures.c @@ -0,0 +1,33 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + yynmatch = 2; + yypmatch[0] = YYCURSOR - 1; + yypmatch[1] = YYCURSOR; + yypmatch[2] = YYCURSOR - 1; + yypmatch[3] = YYCURSOR; + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + ; +} diff --git a/re2c/test/layout/004_08.ci--posix-captures.re b/re2c/test/layout/004_08.ci--posix-captures.re new file mode 100644 index 00000000..868707e1 --- /dev/null +++ b/re2c/test/layout/004_08.ci--posix-captures.re @@ -0,0 +1,4 @@ +/*!re2c + ("a") := ; +*:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/004_09.ci--posix-captures.c b/re2c/test/layout/004_09.ci--posix-captures.c new file mode 100644 index 00000000..403f9871 --- /dev/null +++ b/re2c/test/layout/004_09.ci--posix-captures.c @@ -0,0 +1,35 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + yynmatch = 2; + yypmatch[0] = YYCURSOR - 1; + yypmatch[1] = YYCURSOR; + yypmatch[2] = YYCURSOR - 1; + yypmatch[3] = YYCURSOR; + YYSETCONDITION(yycz); + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + {} +} diff --git a/re2c/test/layout/004_09.ci--posix-captures.re b/re2c/test/layout/004_09.ci--posix-captures.re new file mode 100644 index 00000000..5ee7e3b5 --- /dev/null +++ b/re2c/test/layout/004_09.ci--posix-captures.re @@ -0,0 +1,4 @@ +/*!re2c + ("a") => z {} +*=>x{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/004_10.ci--posix-captures.c b/re2c/test/layout/004_10.ci--posix-captures.c new file mode 100644 index 00000000..d7320529 --- /dev/null +++ b/re2c/test/layout/004_10.ci--posix-captures.c @@ -0,0 +1,35 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + yynmatch = 2; + yypmatch[0] = YYCURSOR - 1; + yypmatch[1] = YYCURSOR; + yypmatch[2] = YYCURSOR - 1; + yypmatch[3] = YYCURSOR; + YYSETCONDITION(yycz); + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + ; +} diff --git a/re2c/test/layout/004_10.ci--posix-captures.re b/re2c/test/layout/004_10.ci--posix-captures.re new file mode 100644 index 00000000..2b252a90 --- /dev/null +++ b/re2c/test/layout/004_10.ci--posix-captures.re @@ -0,0 +1,4 @@ +/*!re2c + ("a") => z := ; +*=>x:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/005_01.i.c b/re2c/test/layout/005_01.i.c new file mode 100644 index 00000000..188476af --- /dev/null +++ b/re2c/test/layout/005_01.i.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/layout/005_01.i.re b/re2c/test/layout/005_01.i.re new file mode 100644 index 00000000..31c4d027 --- /dev/null +++ b/re2c/test/layout/005_01.i.re @@ -0,0 +1,5 @@ +/*!re2c + [a]{} + *{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/005_02.i.c b/re2c/test/layout/005_02.i.c new file mode 100644 index 00000000..188476af --- /dev/null +++ b/re2c/test/layout/005_02.i.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/layout/005_02.i.re b/re2c/test/layout/005_02.i.re new file mode 100644 index 00000000..28cc97c4 --- /dev/null +++ b/re2c/test/layout/005_02.i.re @@ -0,0 +1,5 @@ +/*!re2c +[a] {} +* { +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/005_03.i.c b/re2c/test/layout/005_03.i.c new file mode 100644 index 00000000..188476af --- /dev/null +++ b/re2c/test/layout/005_03.i.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/layout/005_03.i.re b/re2c/test/layout/005_03.i.re new file mode 100644 index 00000000..2b316805 --- /dev/null +++ b/re2c/test/layout/005_03.i.re @@ -0,0 +1,7 @@ +/*!re2c +[a] +{} +* +{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/005_04.i.c b/re2c/test/layout/005_04.i.c new file mode 100644 index 00000000..f1f529dd --- /dev/null +++ b/re2c/test/layout/005_04.i.c @@ -0,0 +1,17 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy3; + default: goto yy2; + } +yy2: +yy3: + ++YYCURSOR; + ; + *:=; +} +re2c: warning: line 3: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/layout/005_04.i.re b/re2c/test/layout/005_04.i.re new file mode 100644 index 00000000..6ebc2b5a --- /dev/null +++ b/re2c/test/layout/005_04.i.re @@ -0,0 +1,4 @@ +/*!re2c + [a]:= ; + *:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/005_05.i.c b/re2c/test/layout/005_05.i.c new file mode 100644 index 00000000..85285a13 --- /dev/null +++ b/re2c/test/layout/005_05.i.c @@ -0,0 +1,17 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; +yy4: + ++YYCURSOR; + ; +} diff --git a/re2c/test/layout/005_05.i.re b/re2c/test/layout/005_05.i.re new file mode 100644 index 00000000..c43015b4 --- /dev/null +++ b/re2c/test/layout/005_05.i.re @@ -0,0 +1,4 @@ +/*!re2c +[a] :=; +* := ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/005_06.i.c b/re2c/test/layout/005_06.i.c new file mode 100644 index 00000000..52026ed5 --- /dev/null +++ b/re2c/test/layout/005_06.i.c @@ -0,0 +1,19 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; + ; +yy4: + ++YYCURSOR; + ; + ; +} diff --git a/re2c/test/layout/005_06.i.re b/re2c/test/layout/005_06.i.re new file mode 100644 index 00000000..10e06e58 --- /dev/null +++ b/re2c/test/layout/005_06.i.re @@ -0,0 +1,6 @@ +/*!re2c +[a] := ; + ; +* := ; + ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/005_07.ci.c b/re2c/test/layout/005_07.ci.c new file mode 100644 index 00000000..c80c44ef --- /dev/null +++ b/re2c/test/layout/005_07.ci.c @@ -0,0 +1,28 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + {} +} diff --git a/re2c/test/layout/005_07.ci.re b/re2c/test/layout/005_07.ci.re new file mode 100644 index 00000000..8da91861 --- /dev/null +++ b/re2c/test/layout/005_07.ci.re @@ -0,0 +1,4 @@ +/*!re2c + [a] {} +< y,x>*{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/005_08.ci.c b/re2c/test/layout/005_08.ci.c new file mode 100644 index 00000000..3e4d06fc --- /dev/null +++ b/re2c/test/layout/005_08.ci.c @@ -0,0 +1,28 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + ; +} diff --git a/re2c/test/layout/005_08.ci.re b/re2c/test/layout/005_08.ci.re new file mode 100644 index 00000000..293c1b00 --- /dev/null +++ b/re2c/test/layout/005_08.ci.re @@ -0,0 +1,4 @@ +/*!re2c + [a] := ; +*:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/005_09.ci.c b/re2c/test/layout/005_09.ci.c new file mode 100644 index 00000000..74ec3da2 --- /dev/null +++ b/re2c/test/layout/005_09.ci.c @@ -0,0 +1,30 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + YYSETCONDITION(yycz); + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + {} +} diff --git a/re2c/test/layout/005_09.ci.re b/re2c/test/layout/005_09.ci.re new file mode 100644 index 00000000..dfc3b8ba --- /dev/null +++ b/re2c/test/layout/005_09.ci.re @@ -0,0 +1,4 @@ +/*!re2c + [a] => z {} +*=>x{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/005_10.ci.c b/re2c/test/layout/005_10.ci.c new file mode 100644 index 00000000..6664b89e --- /dev/null +++ b/re2c/test/layout/005_10.ci.c @@ -0,0 +1,30 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + YYSETCONDITION(yycz); + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + ; +} diff --git a/re2c/test/layout/005_10.ci.re b/re2c/test/layout/005_10.ci.re new file mode 100644 index 00000000..0115adc0 --- /dev/null +++ b/re2c/test/layout/005_10.ci.re @@ -0,0 +1,4 @@ +/*!re2c + [a] => z := ; +*=>x:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/006_01.i.c b/re2c/test/layout/006_01.i.c new file mode 100644 index 00000000..86c0a00a --- /dev/null +++ b/re2c/test/layout/006_01.i.c @@ -0,0 +1,19 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/006_01.i.re b/re2c/test/layout/006_01.i.re new file mode 100644 index 00000000..84cac1b2 --- /dev/null +++ b/re2c/test/layout/006_01.i.re @@ -0,0 +1,5 @@ +/*!re2c + "a"?{} + *{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/006_02.i.c b/re2c/test/layout/006_02.i.c new file mode 100644 index 00000000..86c0a00a --- /dev/null +++ b/re2c/test/layout/006_02.i.c @@ -0,0 +1,19 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/006_02.i.re b/re2c/test/layout/006_02.i.re new file mode 100644 index 00000000..2e298f05 --- /dev/null +++ b/re2c/test/layout/006_02.i.re @@ -0,0 +1,5 @@ +/*!re2c +"a"? {} +* { +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/006_03.i.c b/re2c/test/layout/006_03.i.c new file mode 100644 index 00000000..409df71a --- /dev/null +++ b/re2c/test/layout/006_03.i.c @@ -0,0 +1,19 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} +re2c: warning: line 3: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/006_03.i.re b/re2c/test/layout/006_03.i.re new file mode 100644 index 00000000..cea9a7dc --- /dev/null +++ b/re2c/test/layout/006_03.i.re @@ -0,0 +1,7 @@ +/*!re2c +"a"? +{} +* +{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/006_04.i.c b/re2c/test/layout/006_04.i.c new file mode 100644 index 00000000..9600422b --- /dev/null +++ b/re2c/test/layout/006_04.i.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy3; + default: goto yy2; + } +yy2: + ; + *:=; +yy3: + ++YYCURSOR; + goto yy2; +} +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/006_04.i.re b/re2c/test/layout/006_04.i.re new file mode 100644 index 00000000..bb55eae3 --- /dev/null +++ b/re2c/test/layout/006_04.i.re @@ -0,0 +1,4 @@ +/*!re2c + "a"?:= ; + *:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/006_05.i.c b/re2c/test/layout/006_05.i.c new file mode 100644 index 00000000..c6cf40a4 --- /dev/null +++ b/re2c/test/layout/006_05.i.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; +yy4: + ++YYCURSOR; + ; +} +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/006_05.i.re b/re2c/test/layout/006_05.i.re new file mode 100644 index 00000000..512c6762 --- /dev/null +++ b/re2c/test/layout/006_05.i.re @@ -0,0 +1,4 @@ +/*!re2c +"a"? :=; +* := ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/006_06.i.c b/re2c/test/layout/006_06.i.c new file mode 100644 index 00000000..4aa4b4f7 --- /dev/null +++ b/re2c/test/layout/006_06.i.c @@ -0,0 +1,20 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; + ; +yy4: + ++YYCURSOR; + ; + ; +} +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/006_06.i.re b/re2c/test/layout/006_06.i.re new file mode 100644 index 00000000..50c8ef3e --- /dev/null +++ b/re2c/test/layout/006_06.i.re @@ -0,0 +1,6 @@ +/*!re2c +"a"? := ; + ; +* := ; + ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/006_07.ci.c b/re2c/test/layout/006_07.ci.c new file mode 100644 index 00000000..d43e57bc --- /dev/null +++ b/re2c/test/layout/006_07.ci.c @@ -0,0 +1,29 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + {} +} +re2c: warning: line 2: rule in condition 'x' matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/006_07.ci.re b/re2c/test/layout/006_07.ci.re new file mode 100644 index 00000000..e5be98f7 --- /dev/null +++ b/re2c/test/layout/006_07.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"? {} +< y,x>*{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/006_08.ci.c b/re2c/test/layout/006_08.ci.c new file mode 100644 index 00000000..0190a008 --- /dev/null +++ b/re2c/test/layout/006_08.ci.c @@ -0,0 +1,29 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + ; +} +re2c: warning: line 2: rule in condition 'x' matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/006_08.ci.re b/re2c/test/layout/006_08.ci.re new file mode 100644 index 00000000..cb68b7f2 --- /dev/null +++ b/re2c/test/layout/006_08.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"? := ; +*:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/006_09.ci.c b/re2c/test/layout/006_09.ci.c new file mode 100644 index 00000000..04f433be --- /dev/null +++ b/re2c/test/layout/006_09.ci.c @@ -0,0 +1,31 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + YYSETCONDITION(yycz); + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + {} +} +re2c: warning: line 2: rule in condition 'x' matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/006_09.ci.re b/re2c/test/layout/006_09.ci.re new file mode 100644 index 00000000..8ca60d8c --- /dev/null +++ b/re2c/test/layout/006_09.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"? => z {} +*=>x{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/006_10.ci.c b/re2c/test/layout/006_10.ci.c new file mode 100644 index 00000000..a22a5a99 --- /dev/null +++ b/re2c/test/layout/006_10.ci.c @@ -0,0 +1,31 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + YYSETCONDITION(yycz); + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + ; +} +re2c: warning: line 2: rule in condition 'x' matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/006_10.ci.re b/re2c/test/layout/006_10.ci.re new file mode 100644 index 00000000..e8208e42 --- /dev/null +++ b/re2c/test/layout/006_10.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"? => z := ; +*=>x:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/007_01.i.c b/re2c/test/layout/007_01.i.c new file mode 100644 index 00000000..b7b16f6d --- /dev/null +++ b/re2c/test/layout/007_01.i.c @@ -0,0 +1,26 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + {} +} +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/007_01.i.re b/re2c/test/layout/007_01.i.re new file mode 100644 index 00000000..02e753ff --- /dev/null +++ b/re2c/test/layout/007_01.i.re @@ -0,0 +1,5 @@ +/*!re2c + "a"*{} + *{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/007_02.i.c b/re2c/test/layout/007_02.i.c new file mode 100644 index 00000000..b7b16f6d --- /dev/null +++ b/re2c/test/layout/007_02.i.c @@ -0,0 +1,26 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + {} +} +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/007_02.i.re b/re2c/test/layout/007_02.i.re new file mode 100644 index 00000000..5ac827ba --- /dev/null +++ b/re2c/test/layout/007_02.i.re @@ -0,0 +1,5 @@ +/*!re2c +"a"* {} +* { +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/007_03.i.c b/re2c/test/layout/007_03.i.c new file mode 100644 index 00000000..19fd0d55 --- /dev/null +++ b/re2c/test/layout/007_03.i.c @@ -0,0 +1,26 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + {} +} +re2c: warning: line 3: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/007_03.i.re b/re2c/test/layout/007_03.i.re new file mode 100644 index 00000000..a2180c99 --- /dev/null +++ b/re2c/test/layout/007_03.i.re @@ -0,0 +1,7 @@ +/*!re2c +"a"* +{} +* +{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/007_04.i.c b/re2c/test/layout/007_04.i.c new file mode 100644 index 00000000..316f6126 --- /dev/null +++ b/re2c/test/layout/007_04.i.c @@ -0,0 +1,19 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + goto yy0; +yy1: + ++YYCURSOR; +yy0: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy1; + default: goto yy3; + } +yy3: + ; + *:=; +} +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/007_04.i.re b/re2c/test/layout/007_04.i.re new file mode 100644 index 00000000..24e7e423 --- /dev/null +++ b/re2c/test/layout/007_04.i.re @@ -0,0 +1,4 @@ +/*!re2c + "a"*:= ; + *:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/007_05.i.c b/re2c/test/layout/007_05.i.c new file mode 100644 index 00000000..09229121 --- /dev/null +++ b/re2c/test/layout/007_05.i.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + ; +} +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/007_05.i.re b/re2c/test/layout/007_05.i.re new file mode 100644 index 00000000..40fc4db0 --- /dev/null +++ b/re2c/test/layout/007_05.i.re @@ -0,0 +1,4 @@ +/*!re2c +"a"* :=; +* := ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/007_06.i.c b/re2c/test/layout/007_06.i.c new file mode 100644 index 00000000..db7f1b9b --- /dev/null +++ b/re2c/test/layout/007_06.i.c @@ -0,0 +1,27 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; + ; +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + ; + ; +} +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/007_06.i.re b/re2c/test/layout/007_06.i.re new file mode 100644 index 00000000..e3c99b09 --- /dev/null +++ b/re2c/test/layout/007_06.i.re @@ -0,0 +1,6 @@ +/*!re2c +"a"* := ; + ; +* := ; + ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/007_07.ci.c b/re2c/test/layout/007_07.ci.c new file mode 100644 index 00000000..d3a105b8 --- /dev/null +++ b/re2c/test/layout/007_07.ci.c @@ -0,0 +1,36 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy7; + } +yy7: + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + {} +} +re2c: warning: line 2: rule in condition 'x' matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/007_07.ci.re b/re2c/test/layout/007_07.ci.re new file mode 100644 index 00000000..63af4584 --- /dev/null +++ b/re2c/test/layout/007_07.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"* {} +< y,x>*{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/007_08.ci.c b/re2c/test/layout/007_08.ci.c new file mode 100644 index 00000000..145371a6 --- /dev/null +++ b/re2c/test/layout/007_08.ci.c @@ -0,0 +1,36 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy7; + } +yy7: + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + ; +} +re2c: warning: line 2: rule in condition 'x' matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/007_08.ci.re b/re2c/test/layout/007_08.ci.re new file mode 100644 index 00000000..f1e1a044 --- /dev/null +++ b/re2c/test/layout/007_08.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"* := ; +*:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/007_09.ci.c b/re2c/test/layout/007_09.ci.c new file mode 100644 index 00000000..38ec2523 --- /dev/null +++ b/re2c/test/layout/007_09.ci.c @@ -0,0 +1,38 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy7; + } +yy7: + YYSETCONDITION(yycz); + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + {} +} +re2c: warning: line 2: rule in condition 'x' matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/007_09.ci.re b/re2c/test/layout/007_09.ci.re new file mode 100644 index 00000000..bbcaa6e4 --- /dev/null +++ b/re2c/test/layout/007_09.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"* => z {} +*=>x{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/007_10.ci.c b/re2c/test/layout/007_10.ci.c new file mode 100644 index 00000000..2c9d7d5f --- /dev/null +++ b/re2c/test/layout/007_10.ci.c @@ -0,0 +1,38 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy7; + } +yy7: + YYSETCONDITION(yycz); + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + ; +} +re2c: warning: line 2: rule in condition 'x' matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/layout/007_10.ci.re b/re2c/test/layout/007_10.ci.re new file mode 100644 index 00000000..5347d205 --- /dev/null +++ b/re2c/test/layout/007_10.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"* => z := ; +*=>x:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/008_01.i.c b/re2c/test/layout/008_01.i.c new file mode 100644 index 00000000..9eb4d777 --- /dev/null +++ b/re2c/test/layout/008_01.i.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + {} +} diff --git a/re2c/test/layout/008_01.i.re b/re2c/test/layout/008_01.i.re new file mode 100644 index 00000000..91dc9012 --- /dev/null +++ b/re2c/test/layout/008_01.i.re @@ -0,0 +1,5 @@ +/*!re2c + "a"+{} + *{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/008_02.i.c b/re2c/test/layout/008_02.i.c new file mode 100644 index 00000000..9eb4d777 --- /dev/null +++ b/re2c/test/layout/008_02.i.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + {} +} diff --git a/re2c/test/layout/008_02.i.re b/re2c/test/layout/008_02.i.re new file mode 100644 index 00000000..1451b1eb --- /dev/null +++ b/re2c/test/layout/008_02.i.re @@ -0,0 +1,5 @@ +/*!re2c +"a"+ {} +* { +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/008_03.i.c b/re2c/test/layout/008_03.i.c new file mode 100644 index 00000000..9eb4d777 --- /dev/null +++ b/re2c/test/layout/008_03.i.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + {} +} diff --git a/re2c/test/layout/008_03.i.re b/re2c/test/layout/008_03.i.re new file mode 100644 index 00000000..903e3e19 --- /dev/null +++ b/re2c/test/layout/008_03.i.re @@ -0,0 +1,7 @@ +/*!re2c +"a"+ +{} +* +{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/008_04.i.c b/re2c/test/layout/008_04.i.c new file mode 100644 index 00000000..2d0e971f --- /dev/null +++ b/re2c/test/layout/008_04.i.c @@ -0,0 +1,24 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy3; + default: goto yy2; + } +yy2: +yy3: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy3; + default: goto yy5; + } +yy5: + ; + *:=; +} +re2c: warning: line 3: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/layout/008_04.i.re b/re2c/test/layout/008_04.i.re new file mode 100644 index 00000000..8865e1e9 --- /dev/null +++ b/re2c/test/layout/008_04.i.re @@ -0,0 +1,4 @@ +/*!re2c + "a"+:= ; + *:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/008_05.i.c b/re2c/test/layout/008_05.i.c new file mode 100644 index 00000000..92740160 --- /dev/null +++ b/re2c/test/layout/008_05.i.c @@ -0,0 +1,24 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + ; +} diff --git a/re2c/test/layout/008_05.i.re b/re2c/test/layout/008_05.i.re new file mode 100644 index 00000000..f2d3e626 --- /dev/null +++ b/re2c/test/layout/008_05.i.re @@ -0,0 +1,4 @@ +/*!re2c +"a"+ :=; +* := ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/008_06.i.c b/re2c/test/layout/008_06.i.c new file mode 100644 index 00000000..a0c9dc66 --- /dev/null +++ b/re2c/test/layout/008_06.i.c @@ -0,0 +1,26 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; + ; +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + ; + ; +} diff --git a/re2c/test/layout/008_06.i.re b/re2c/test/layout/008_06.i.re new file mode 100644 index 00000000..32475a79 --- /dev/null +++ b/re2c/test/layout/008_06.i.re @@ -0,0 +1,6 @@ +/*!re2c +"a"+ := ; + ; +* := ; + ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/008_07.ci.c b/re2c/test/layout/008_07.ci.c new file mode 100644 index 00000000..accac46d --- /dev/null +++ b/re2c/test/layout/008_07.ci.c @@ -0,0 +1,35 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy7; + } +yy7: + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + {} +} diff --git a/re2c/test/layout/008_07.ci.re b/re2c/test/layout/008_07.ci.re new file mode 100644 index 00000000..29b86a19 --- /dev/null +++ b/re2c/test/layout/008_07.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"+ {} +< y,x>*{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/008_08.ci.c b/re2c/test/layout/008_08.ci.c new file mode 100644 index 00000000..5788a980 --- /dev/null +++ b/re2c/test/layout/008_08.ci.c @@ -0,0 +1,35 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy7; + } +yy7: + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + ; +} diff --git a/re2c/test/layout/008_08.ci.re b/re2c/test/layout/008_08.ci.re new file mode 100644 index 00000000..bb362565 --- /dev/null +++ b/re2c/test/layout/008_08.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"+ := ; +*:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/008_09.ci.c b/re2c/test/layout/008_09.ci.c new file mode 100644 index 00000000..8820676e --- /dev/null +++ b/re2c/test/layout/008_09.ci.c @@ -0,0 +1,37 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy7; + } +yy7: + YYSETCONDITION(yycz); + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + {} +} diff --git a/re2c/test/layout/008_09.ci.re b/re2c/test/layout/008_09.ci.re new file mode 100644 index 00000000..424eedc0 --- /dev/null +++ b/re2c/test/layout/008_09.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"+ => z {} +*=>x{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/008_10.ci.c b/re2c/test/layout/008_10.ci.c new file mode 100644 index 00000000..6fa977eb --- /dev/null +++ b/re2c/test/layout/008_10.ci.c @@ -0,0 +1,37 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy7; + } +yy7: + YYSETCONDITION(yycz); + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + ; +} diff --git a/re2c/test/layout/008_10.ci.re b/re2c/test/layout/008_10.ci.re new file mode 100644 index 00000000..87b90bc0 --- /dev/null +++ b/re2c/test/layout/008_10.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"+ => z := ; +*=>x:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/009_01.i.c b/re2c/test/layout/009_01.i.c new file mode 100644 index 00000000..188476af --- /dev/null +++ b/re2c/test/layout/009_01.i.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/layout/009_01.i.re b/re2c/test/layout/009_01.i.re new file mode 100644 index 00000000..bb8a70f4 --- /dev/null +++ b/re2c/test/layout/009_01.i.re @@ -0,0 +1,5 @@ +/*!re2c + "a"{1}{} + *{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/009_02.i.c b/re2c/test/layout/009_02.i.c new file mode 100644 index 00000000..188476af --- /dev/null +++ b/re2c/test/layout/009_02.i.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/layout/009_02.i.re b/re2c/test/layout/009_02.i.re new file mode 100644 index 00000000..3fb36255 --- /dev/null +++ b/re2c/test/layout/009_02.i.re @@ -0,0 +1,5 @@ +/*!re2c +"a"{1} {} +* { +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/009_03.i.c b/re2c/test/layout/009_03.i.c new file mode 100644 index 00000000..188476af --- /dev/null +++ b/re2c/test/layout/009_03.i.c @@ -0,0 +1,18 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + {} +} diff --git a/re2c/test/layout/009_03.i.re b/re2c/test/layout/009_03.i.re new file mode 100644 index 00000000..09dd6ac4 --- /dev/null +++ b/re2c/test/layout/009_03.i.re @@ -0,0 +1,7 @@ +/*!re2c +"a"{1} +{} +* +{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/009_04.i.c b/re2c/test/layout/009_04.i.c new file mode 100644 index 00000000..f1f529dd --- /dev/null +++ b/re2c/test/layout/009_04.i.c @@ -0,0 +1,17 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy3; + default: goto yy2; + } +yy2: +yy3: + ++YYCURSOR; + ; + *:=; +} +re2c: warning: line 3: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/layout/009_04.i.re b/re2c/test/layout/009_04.i.re new file mode 100644 index 00000000..be64fcb9 --- /dev/null +++ b/re2c/test/layout/009_04.i.re @@ -0,0 +1,4 @@ +/*!re2c + "a"{1}:= ; + *:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/009_05.i.c b/re2c/test/layout/009_05.i.c new file mode 100644 index 00000000..85285a13 --- /dev/null +++ b/re2c/test/layout/009_05.i.c @@ -0,0 +1,17 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; +yy4: + ++YYCURSOR; + ; +} diff --git a/re2c/test/layout/009_05.i.re b/re2c/test/layout/009_05.i.re new file mode 100644 index 00000000..5c0cc258 --- /dev/null +++ b/re2c/test/layout/009_05.i.re @@ -0,0 +1,4 @@ +/*!re2c +"a"{1} :=; +* := ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/009_06.i.c b/re2c/test/layout/009_06.i.c new file mode 100644 index 00000000..52026ed5 --- /dev/null +++ b/re2c/test/layout/009_06.i.c @@ -0,0 +1,19 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; + ; +yy4: + ++YYCURSOR; + ; + ; +} diff --git a/re2c/test/layout/009_06.i.re b/re2c/test/layout/009_06.i.re new file mode 100644 index 00000000..db162d3a --- /dev/null +++ b/re2c/test/layout/009_06.i.re @@ -0,0 +1,6 @@ +/*!re2c +"a"{1} := ; + ; +* := ; + ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/009_07.ci.c b/re2c/test/layout/009_07.ci.c new file mode 100644 index 00000000..c80c44ef --- /dev/null +++ b/re2c/test/layout/009_07.ci.c @@ -0,0 +1,28 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + {} +} diff --git a/re2c/test/layout/009_07.ci.re b/re2c/test/layout/009_07.ci.re new file mode 100644 index 00000000..7ac9c149 --- /dev/null +++ b/re2c/test/layout/009_07.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"{1} {} +< y,x>*{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/009_08.ci.c b/re2c/test/layout/009_08.ci.c new file mode 100644 index 00000000..3e4d06fc --- /dev/null +++ b/re2c/test/layout/009_08.ci.c @@ -0,0 +1,28 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + ; +} diff --git a/re2c/test/layout/009_08.ci.re b/re2c/test/layout/009_08.ci.re new file mode 100644 index 00000000..cf7d31ce --- /dev/null +++ b/re2c/test/layout/009_08.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"{1} := ; +*:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/009_09.ci.c b/re2c/test/layout/009_09.ci.c new file mode 100644 index 00000000..74ec3da2 --- /dev/null +++ b/re2c/test/layout/009_09.ci.c @@ -0,0 +1,30 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + YYSETCONDITION(yycz); + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + {} +} diff --git a/re2c/test/layout/009_09.ci.re b/re2c/test/layout/009_09.ci.re new file mode 100644 index 00000000..5ea47b53 --- /dev/null +++ b/re2c/test/layout/009_09.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"{1} => z {} +*=>x{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/009_10.ci.c b/re2c/test/layout/009_10.ci.c new file mode 100644 index 00000000..6664b89e --- /dev/null +++ b/re2c/test/layout/009_10.ci.c @@ -0,0 +1,30 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + YYSETCONDITION(yycz); + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + ; +} diff --git a/re2c/test/layout/009_10.ci.re b/re2c/test/layout/009_10.ci.re new file mode 100644 index 00000000..0e4487ff --- /dev/null +++ b/re2c/test/layout/009_10.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"{1} => z := ; +*=>x:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/010_01.i.c b/re2c/test/layout/010_01.i.c new file mode 100644 index 00000000..9eb4d777 --- /dev/null +++ b/re2c/test/layout/010_01.i.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + {} +} diff --git a/re2c/test/layout/010_01.i.re b/re2c/test/layout/010_01.i.re new file mode 100644 index 00000000..6ce587ce --- /dev/null +++ b/re2c/test/layout/010_01.i.re @@ -0,0 +1,5 @@ +/*!re2c + "a"{1,}{} + *{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/010_02.i.c b/re2c/test/layout/010_02.i.c new file mode 100644 index 00000000..9eb4d777 --- /dev/null +++ b/re2c/test/layout/010_02.i.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + {} +} diff --git a/re2c/test/layout/010_02.i.re b/re2c/test/layout/010_02.i.re new file mode 100644 index 00000000..9c4ca7d4 --- /dev/null +++ b/re2c/test/layout/010_02.i.re @@ -0,0 +1,5 @@ +/*!re2c +"a"{1,} {} +* { +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/010_03.i.c b/re2c/test/layout/010_03.i.c new file mode 100644 index 00000000..9eb4d777 --- /dev/null +++ b/re2c/test/layout/010_03.i.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + {} +} diff --git a/re2c/test/layout/010_03.i.re b/re2c/test/layout/010_03.i.re new file mode 100644 index 00000000..d150ce37 --- /dev/null +++ b/re2c/test/layout/010_03.i.re @@ -0,0 +1,7 @@ +/*!re2c +"a"{1,} +{} +* +{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/010_04.i.c b/re2c/test/layout/010_04.i.c new file mode 100644 index 00000000..2d0e971f --- /dev/null +++ b/re2c/test/layout/010_04.i.c @@ -0,0 +1,24 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy3; + default: goto yy2; + } +yy2: +yy3: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy3; + default: goto yy5; + } +yy5: + ; + *:=; +} +re2c: warning: line 3: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/layout/010_04.i.re b/re2c/test/layout/010_04.i.re new file mode 100644 index 00000000..6bbdb22e --- /dev/null +++ b/re2c/test/layout/010_04.i.re @@ -0,0 +1,4 @@ +/*!re2c + "a"{1,}:= ; + *:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/010_05.i.c b/re2c/test/layout/010_05.i.c new file mode 100644 index 00000000..92740160 --- /dev/null +++ b/re2c/test/layout/010_05.i.c @@ -0,0 +1,24 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + ; +} diff --git a/re2c/test/layout/010_05.i.re b/re2c/test/layout/010_05.i.re new file mode 100644 index 00000000..3b3360ad --- /dev/null +++ b/re2c/test/layout/010_05.i.re @@ -0,0 +1,4 @@ +/*!re2c +"a"{1,} :=; +* := ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/010_06.i.c b/re2c/test/layout/010_06.i.c new file mode 100644 index 00000000..a0c9dc66 --- /dev/null +++ b/re2c/test/layout/010_06.i.c @@ -0,0 +1,26 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; + ; +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy6; + } +yy6: + ; + ; +} diff --git a/re2c/test/layout/010_06.i.re b/re2c/test/layout/010_06.i.re new file mode 100644 index 00000000..7240238e --- /dev/null +++ b/re2c/test/layout/010_06.i.re @@ -0,0 +1,6 @@ +/*!re2c +"a"{1,} := ; + ; +* := ; + ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/010_07.ci.c b/re2c/test/layout/010_07.ci.c new file mode 100644 index 00000000..accac46d --- /dev/null +++ b/re2c/test/layout/010_07.ci.c @@ -0,0 +1,35 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy7; + } +yy7: + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + {} +} diff --git a/re2c/test/layout/010_07.ci.re b/re2c/test/layout/010_07.ci.re new file mode 100644 index 00000000..1b48e3e7 --- /dev/null +++ b/re2c/test/layout/010_07.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"{1,} {} +< y,x>*{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/010_08.ci.c b/re2c/test/layout/010_08.ci.c new file mode 100644 index 00000000..5788a980 --- /dev/null +++ b/re2c/test/layout/010_08.ci.c @@ -0,0 +1,35 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy7; + } +yy7: + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + ; +} diff --git a/re2c/test/layout/010_08.ci.re b/re2c/test/layout/010_08.ci.re new file mode 100644 index 00000000..54948f90 --- /dev/null +++ b/re2c/test/layout/010_08.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"{1,} := ; +*:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/010_09.ci.c b/re2c/test/layout/010_09.ci.c new file mode 100644 index 00000000..8820676e --- /dev/null +++ b/re2c/test/layout/010_09.ci.c @@ -0,0 +1,37 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy7; + } +yy7: + YYSETCONDITION(yycz); + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + {} +} diff --git a/re2c/test/layout/010_09.ci.re b/re2c/test/layout/010_09.ci.re new file mode 100644 index 00000000..fa09ab89 --- /dev/null +++ b/re2c/test/layout/010_09.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"{1,} => z {} +*=>x{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/010_10.ci.c b/re2c/test/layout/010_10.ci.c new file mode 100644 index 00000000..6fa977eb --- /dev/null +++ b/re2c/test/layout/010_10.ci.c @@ -0,0 +1,37 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy7; + } +yy7: + YYSETCONDITION(yycz); + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + ; +} diff --git a/re2c/test/layout/010_10.ci.re b/re2c/test/layout/010_10.ci.re new file mode 100644 index 00000000..6c89c9cc --- /dev/null +++ b/re2c/test/layout/010_10.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"{1,} => z := ; +*=>x:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/011_01.i.c b/re2c/test/layout/011_01.i.c new file mode 100644 index 00000000..d05d4b76 --- /dev/null +++ b/re2c/test/layout/011_01.i.c @@ -0,0 +1,26 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy6; + default: goto yy5; + } +yy5: + {} +yy6: + ++YYCURSOR; + goto yy5; +} diff --git a/re2c/test/layout/011_01.i.re b/re2c/test/layout/011_01.i.re new file mode 100644 index 00000000..9d056d78 --- /dev/null +++ b/re2c/test/layout/011_01.i.re @@ -0,0 +1,5 @@ +/*!re2c + "a"{1,2}{} + *{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/011_02.i.c b/re2c/test/layout/011_02.i.c new file mode 100644 index 00000000..d05d4b76 --- /dev/null +++ b/re2c/test/layout/011_02.i.c @@ -0,0 +1,26 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy6; + default: goto yy5; + } +yy5: + {} +yy6: + ++YYCURSOR; + goto yy5; +} diff --git a/re2c/test/layout/011_02.i.re b/re2c/test/layout/011_02.i.re new file mode 100644 index 00000000..459f8f25 --- /dev/null +++ b/re2c/test/layout/011_02.i.re @@ -0,0 +1,5 @@ +/*!re2c +"a"{1,2} {} +* { +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/011_03.i.c b/re2c/test/layout/011_03.i.c new file mode 100644 index 00000000..d05d4b76 --- /dev/null +++ b/re2c/test/layout/011_03.i.c @@ -0,0 +1,26 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy6; + default: goto yy5; + } +yy5: + {} +yy6: + ++YYCURSOR; + goto yy5; +} diff --git a/re2c/test/layout/011_03.i.re b/re2c/test/layout/011_03.i.re new file mode 100644 index 00000000..cfa20bc4 --- /dev/null +++ b/re2c/test/layout/011_03.i.re @@ -0,0 +1,7 @@ +/*!re2c +"a"{1,2} +{} +* +{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/011_04.i.c b/re2c/test/layout/011_04.i.c new file mode 100644 index 00000000..f46e1eba --- /dev/null +++ b/re2c/test/layout/011_04.i.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy3; + default: goto yy2; + } +yy2: +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy4; + } +yy4: + ; + *:=; +yy5: + ++YYCURSOR; + goto yy4; +} +re2c: warning: line 3: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/layout/011_04.i.re b/re2c/test/layout/011_04.i.re new file mode 100644 index 00000000..19e488d7 --- /dev/null +++ b/re2c/test/layout/011_04.i.re @@ -0,0 +1,4 @@ +/*!re2c + "a"{1,2}:= ; + *:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/011_05.i.c b/re2c/test/layout/011_05.i.c new file mode 100644 index 00000000..73dc48b3 --- /dev/null +++ b/re2c/test/layout/011_05.i.c @@ -0,0 +1,25 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy6; + default: goto yy5; + } +yy5: + ; +yy6: + ++YYCURSOR; + goto yy5; +} diff --git a/re2c/test/layout/011_05.i.re b/re2c/test/layout/011_05.i.re new file mode 100644 index 00000000..5f1d38b0 --- /dev/null +++ b/re2c/test/layout/011_05.i.re @@ -0,0 +1,4 @@ +/*!re2c +"a"{1,2} :=; +* := ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/011_06.i.c b/re2c/test/layout/011_06.i.c new file mode 100644 index 00000000..3baa5fa0 --- /dev/null +++ b/re2c/test/layout/011_06.i.c @@ -0,0 +1,27 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; + ; +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy6; + default: goto yy5; + } +yy5: + ; + ; +yy6: + ++YYCURSOR; + goto yy5; +} diff --git a/re2c/test/layout/011_06.i.re b/re2c/test/layout/011_06.i.re new file mode 100644 index 00000000..ec07dba5 --- /dev/null +++ b/re2c/test/layout/011_06.i.re @@ -0,0 +1,6 @@ +/*!re2c +"a"{1,2} := ; + ; +* := ; + ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/011_07.ci.c b/re2c/test/layout/011_07.ci.c new file mode 100644 index 00000000..dd071bfd --- /dev/null +++ b/re2c/test/layout/011_07.ci.c @@ -0,0 +1,36 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy7; + default: goto yy6; + } +yy6: + {} +yy7: + ++YYCURSOR; + goto yy6; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + {} +} diff --git a/re2c/test/layout/011_07.ci.re b/re2c/test/layout/011_07.ci.re new file mode 100644 index 00000000..70c18ba2 --- /dev/null +++ b/re2c/test/layout/011_07.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"{1,2} {} +< y,x>*{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/011_08.ci.c b/re2c/test/layout/011_08.ci.c new file mode 100644 index 00000000..2828dd03 --- /dev/null +++ b/re2c/test/layout/011_08.ci.c @@ -0,0 +1,36 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy7; + default: goto yy6; + } +yy6: + ; +yy7: + ++YYCURSOR; + goto yy6; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + ; +} diff --git a/re2c/test/layout/011_08.ci.re b/re2c/test/layout/011_08.ci.re new file mode 100644 index 00000000..17944c89 --- /dev/null +++ b/re2c/test/layout/011_08.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"{1,2} := ; +*:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/011_09.ci.c b/re2c/test/layout/011_09.ci.c new file mode 100644 index 00000000..7922214b --- /dev/null +++ b/re2c/test/layout/011_09.ci.c @@ -0,0 +1,38 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy7; + default: goto yy6; + } +yy6: + YYSETCONDITION(yycz); + {} +yy7: + ++YYCURSOR; + goto yy6; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + {} +} diff --git a/re2c/test/layout/011_09.ci.re b/re2c/test/layout/011_09.ci.re new file mode 100644 index 00000000..ba5ef055 --- /dev/null +++ b/re2c/test/layout/011_09.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"{1,2} => z {} +*=>x{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/011_10.ci.c b/re2c/test/layout/011_10.ci.c new file mode 100644 index 00000000..27f68088 --- /dev/null +++ b/re2c/test/layout/011_10.ci.c @@ -0,0 +1,38 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy7; + default: goto yy6; + } +yy6: + YYSETCONDITION(yycz); + ; +yy7: + ++YYCURSOR; + goto yy6; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + ; +} diff --git a/re2c/test/layout/011_10.ci.re b/re2c/test/layout/011_10.ci.re new file mode 100644 index 00000000..8685298c --- /dev/null +++ b/re2c/test/layout/011_10.ci.re @@ -0,0 +1,4 @@ +/*!re2c + "a"{1,2} => z := ; +*=>x:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/012_01.i--tags.c b/re2c/test/layout/012_01.i--tags.c new file mode 100644 index 00000000..635884a1 --- /dev/null +++ b/re2c/test/layout/012_01.i--tags.c @@ -0,0 +1,20 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + x = YYCURSOR - 1; + y = YYCURSOR; + {} +} diff --git a/re2c/test/layout/012_01.i--tags.re b/re2c/test/layout/012_01.i--tags.re new file mode 100644 index 00000000..940dcec6 --- /dev/null +++ b/re2c/test/layout/012_01.i--tags.re @@ -0,0 +1,5 @@ +/*!re2c + @x "a" @y{} + *{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/012_02.i--tags.c b/re2c/test/layout/012_02.i--tags.c new file mode 100644 index 00000000..635884a1 --- /dev/null +++ b/re2c/test/layout/012_02.i--tags.c @@ -0,0 +1,20 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + x = YYCURSOR - 1; + y = YYCURSOR; + {} +} diff --git a/re2c/test/layout/012_02.i--tags.re b/re2c/test/layout/012_02.i--tags.re new file mode 100644 index 00000000..64d3053c --- /dev/null +++ b/re2c/test/layout/012_02.i--tags.re @@ -0,0 +1,5 @@ +/*!re2c +@x "a" @y {} +* { +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/012_03.i--tags.c b/re2c/test/layout/012_03.i--tags.c new file mode 100644 index 00000000..635884a1 --- /dev/null +++ b/re2c/test/layout/012_03.i--tags.c @@ -0,0 +1,20 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + x = YYCURSOR - 1; + y = YYCURSOR; + {} +} diff --git a/re2c/test/layout/012_03.i--tags.re b/re2c/test/layout/012_03.i--tags.re new file mode 100644 index 00000000..c003fc3e --- /dev/null +++ b/re2c/test/layout/012_03.i--tags.re @@ -0,0 +1,7 @@ +/*!re2c +@x "a" @y +{} +* +{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/012_04.i--tags.c b/re2c/test/layout/012_04.i--tags.c new file mode 100644 index 00000000..03c004d9 --- /dev/null +++ b/re2c/test/layout/012_04.i--tags.c @@ -0,0 +1,19 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy3; + default: goto yy2; + } +yy2: +yy3: + ++YYCURSOR; + x = YYCURSOR - 1; + y = YYCURSOR; + ; + *:=; +} +re2c: warning: line 3: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/layout/012_04.i--tags.re b/re2c/test/layout/012_04.i--tags.re new file mode 100644 index 00000000..7dc07a9c --- /dev/null +++ b/re2c/test/layout/012_04.i--tags.re @@ -0,0 +1,4 @@ +/*!re2c + @x "a" @y:= ; + *:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/012_05.i--tags.c b/re2c/test/layout/012_05.i--tags.c new file mode 100644 index 00000000..1fd77ec4 --- /dev/null +++ b/re2c/test/layout/012_05.i--tags.c @@ -0,0 +1,19 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; +yy4: + ++YYCURSOR; + x = YYCURSOR - 1; + y = YYCURSOR; + ; +} diff --git a/re2c/test/layout/012_05.i--tags.re b/re2c/test/layout/012_05.i--tags.re new file mode 100644 index 00000000..85b3cc2c --- /dev/null +++ b/re2c/test/layout/012_05.i--tags.re @@ -0,0 +1,4 @@ +/*!re2c +@x "a" @y :=; +* := ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/012_06.i--tags.c b/re2c/test/layout/012_06.i--tags.c new file mode 100644 index 00000000..e4d64ae7 --- /dev/null +++ b/re2c/test/layout/012_06.i--tags.c @@ -0,0 +1,21 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; + ; +yy4: + ++YYCURSOR; + x = YYCURSOR - 1; + y = YYCURSOR; + ; + ; +} diff --git a/re2c/test/layout/012_06.i--tags.re b/re2c/test/layout/012_06.i--tags.re new file mode 100644 index 00000000..a7cebadc --- /dev/null +++ b/re2c/test/layout/012_06.i--tags.re @@ -0,0 +1,6 @@ +/*!re2c +@x "a" @y := ; + ; +* := ; + ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/012_07.ci--tags.c b/re2c/test/layout/012_07.ci--tags.c new file mode 100644 index 00000000..8c312b07 --- /dev/null +++ b/re2c/test/layout/012_07.ci--tags.c @@ -0,0 +1,30 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + x = YYCURSOR - 1; + y = YYCURSOR; + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + {} +} diff --git a/re2c/test/layout/012_07.ci--tags.re b/re2c/test/layout/012_07.ci--tags.re new file mode 100644 index 00000000..bfe07e68 --- /dev/null +++ b/re2c/test/layout/012_07.ci--tags.re @@ -0,0 +1,4 @@ +/*!re2c + @x "a" @y {} +< y,x>*{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/012_08.ci--tags.c b/re2c/test/layout/012_08.ci--tags.c new file mode 100644 index 00000000..7d7a46a5 --- /dev/null +++ b/re2c/test/layout/012_08.ci--tags.c @@ -0,0 +1,30 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + x = YYCURSOR - 1; + y = YYCURSOR; + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + ; +} diff --git a/re2c/test/layout/012_08.ci--tags.re b/re2c/test/layout/012_08.ci--tags.re new file mode 100644 index 00000000..108d1159 --- /dev/null +++ b/re2c/test/layout/012_08.ci--tags.re @@ -0,0 +1,4 @@ +/*!re2c + @x "a" @y := ; +*:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/012_09.ci--tags.c b/re2c/test/layout/012_09.ci--tags.c new file mode 100644 index 00000000..3c612ca7 --- /dev/null +++ b/re2c/test/layout/012_09.ci--tags.c @@ -0,0 +1,32 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + x = YYCURSOR - 1; + y = YYCURSOR; + YYSETCONDITION(yycz); + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + {} +} diff --git a/re2c/test/layout/012_09.ci--tags.re b/re2c/test/layout/012_09.ci--tags.re new file mode 100644 index 00000000..46dec13e --- /dev/null +++ b/re2c/test/layout/012_09.ci--tags.re @@ -0,0 +1,4 @@ +/*!re2c + @x "a" @y => z {} +*=>x{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/012_10.ci--tags.c b/re2c/test/layout/012_10.ci--tags.c new file mode 100644 index 00000000..f16ea521 --- /dev/null +++ b/re2c/test/layout/012_10.ci--tags.c @@ -0,0 +1,32 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + x = YYCURSOR - 1; + y = YYCURSOR; + YYSETCONDITION(yycz); + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + ; +} diff --git a/re2c/test/layout/012_10.ci--tags.re b/re2c/test/layout/012_10.ci--tags.re new file mode 100644 index 00000000..6fbe93bb --- /dev/null +++ b/re2c/test/layout/012_10.ci--tags.re @@ -0,0 +1,4 @@ +/*!re2c + @x "a" @y => z := ; +*=>x:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/013_01.i--tags.c b/re2c/test/layout/013_01.i--tags.c new file mode 100644 index 00000000..80487e75 --- /dev/null +++ b/re2c/test/layout/013_01.i--tags.c @@ -0,0 +1,23 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + YYMTAGP (yyt3); + goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + YYMTAGP (yyt2); + x = yyt3; + y = yyt2; + {} +} diff --git a/re2c/test/layout/013_01.i--tags.re b/re2c/test/layout/013_01.i--tags.re new file mode 100644 index 00000000..1551e72d --- /dev/null +++ b/re2c/test/layout/013_01.i--tags.re @@ -0,0 +1,5 @@ +/*!re2c + #x "a" #y{} + *{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/013_02.i--tags.c b/re2c/test/layout/013_02.i--tags.c new file mode 100644 index 00000000..80487e75 --- /dev/null +++ b/re2c/test/layout/013_02.i--tags.c @@ -0,0 +1,23 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + YYMTAGP (yyt3); + goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + YYMTAGP (yyt2); + x = yyt3; + y = yyt2; + {} +} diff --git a/re2c/test/layout/013_02.i--tags.re b/re2c/test/layout/013_02.i--tags.re new file mode 100644 index 00000000..0e753573 --- /dev/null +++ b/re2c/test/layout/013_02.i--tags.re @@ -0,0 +1,5 @@ +/*!re2c +#x "a" #y {} +* { +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/013_03.i--tags.c b/re2c/test/layout/013_03.i--tags.c new file mode 100644 index 00000000..80487e75 --- /dev/null +++ b/re2c/test/layout/013_03.i--tags.c @@ -0,0 +1,23 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + YYMTAGP (yyt3); + goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + { +} +yy4: + ++YYCURSOR; + YYMTAGP (yyt2); + x = yyt3; + y = yyt2; + {} +} diff --git a/re2c/test/layout/013_03.i--tags.re b/re2c/test/layout/013_03.i--tags.re new file mode 100644 index 00000000..8c04ab48 --- /dev/null +++ b/re2c/test/layout/013_03.i--tags.re @@ -0,0 +1,7 @@ +/*!re2c +#x "a" #y +{} +* +{ +} +*/ \ No newline at end of file diff --git a/re2c/test/layout/013_04.i--tags.c b/re2c/test/layout/013_04.i--tags.c new file mode 100644 index 00000000..d10de8db --- /dev/null +++ b/re2c/test/layout/013_04.i--tags.c @@ -0,0 +1,22 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + YYMTAGP (yyt3); + goto yy3; + default: goto yy2; + } +yy2: +yy3: + ++YYCURSOR; + YYMTAGP (yyt2); + x = yyt3; + y = yyt2; + ; + *:=; +} +re2c: warning: line 3: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] diff --git a/re2c/test/layout/013_04.i--tags.re b/re2c/test/layout/013_04.i--tags.re new file mode 100644 index 00000000..d3c0ef31 --- /dev/null +++ b/re2c/test/layout/013_04.i--tags.re @@ -0,0 +1,4 @@ +/*!re2c + #x "a" #y:= ; + *:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/013_05.i--tags.c b/re2c/test/layout/013_05.i--tags.c new file mode 100644 index 00000000..2c70b35e --- /dev/null +++ b/re2c/test/layout/013_05.i--tags.c @@ -0,0 +1,22 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + YYMTAGP (yyt3); + goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; +yy4: + ++YYCURSOR; + YYMTAGP (yyt2); + x = yyt3; + y = yyt2; + ; +} diff --git a/re2c/test/layout/013_05.i--tags.re b/re2c/test/layout/013_05.i--tags.re new file mode 100644 index 00000000..5833dd48 --- /dev/null +++ b/re2c/test/layout/013_05.i--tags.re @@ -0,0 +1,4 @@ +/*!re2c +#x "a" #y :=; +* := ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/013_06.i--tags.c b/re2c/test/layout/013_06.i--tags.c new file mode 100644 index 00000000..2edd2938 --- /dev/null +++ b/re2c/test/layout/013_06.i--tags.c @@ -0,0 +1,24 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + YYMTAGP (yyt3); + goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + ; + ; +yy4: + ++YYCURSOR; + YYMTAGP (yyt2); + x = yyt3; + y = yyt2; + ; + ; +} diff --git a/re2c/test/layout/013_06.i--tags.re b/re2c/test/layout/013_06.i--tags.re new file mode 100644 index 00000000..7269d919 --- /dev/null +++ b/re2c/test/layout/013_06.i--tags.re @@ -0,0 +1,6 @@ +/*!re2c +#x "a" #y := ; + ; +* := ; + ; +*/ \ No newline at end of file diff --git a/re2c/test/layout/013_07.ci--tags.c b/re2c/test/layout/013_07.ci--tags.c new file mode 100644 index 00000000..7bea1072 --- /dev/null +++ b/re2c/test/layout/013_07.ci--tags.c @@ -0,0 +1,33 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + YYMTAGP (yyt3); + goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + YYMTAGP (yyt2); + x = yyt3; + y = yyt2; + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + {} +} diff --git a/re2c/test/layout/013_07.ci--tags.re b/re2c/test/layout/013_07.ci--tags.re new file mode 100644 index 00000000..c951a43f --- /dev/null +++ b/re2c/test/layout/013_07.ci--tags.re @@ -0,0 +1,4 @@ +/*!re2c + #x "a" #y {} +< y,x>*{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/013_08.ci--tags.c b/re2c/test/layout/013_08.ci--tags.c new file mode 100644 index 00000000..d9bde276 --- /dev/null +++ b/re2c/test/layout/013_08.ci--tags.c @@ -0,0 +1,33 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + YYMTAGP (yyt3); + goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + YYMTAGP (yyt2); + x = yyt3; + y = yyt2; + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + ; +} diff --git a/re2c/test/layout/013_08.ci--tags.re b/re2c/test/layout/013_08.ci--tags.re new file mode 100644 index 00000000..78fecd05 --- /dev/null +++ b/re2c/test/layout/013_08.ci--tags.re @@ -0,0 +1,4 @@ +/*!re2c + #x "a" #y := ; +*:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/013_09.ci--tags.c b/re2c/test/layout/013_09.ci--tags.c new file mode 100644 index 00000000..0a909350 --- /dev/null +++ b/re2c/test/layout/013_09.ci--tags.c @@ -0,0 +1,35 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + YYMTAGP (yyt3); + goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + {} +yy5: + ++YYCURSOR; + YYMTAGP (yyt2); + x = yyt3; + y = yyt2; + YYSETCONDITION(yycz); + {} +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + {} +} diff --git a/re2c/test/layout/013_09.ci--tags.re b/re2c/test/layout/013_09.ci--tags.re new file mode 100644 index 00000000..9d8c3a0a --- /dev/null +++ b/re2c/test/layout/013_09.ci--tags.re @@ -0,0 +1,4 @@ +/*!re2c + #x "a" #y => z {} +*=>x{} +*/ \ No newline at end of file diff --git a/re2c/test/layout/013_10.ci--tags.c b/re2c/test/layout/013_10.ci--tags.c new file mode 100644 index 00000000..ecb9ed99 --- /dev/null +++ b/re2c/test/layout/013_10.ci--tags.c @@ -0,0 +1,35 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + switch (YYGETCONDITION()) { + case yycx: goto yyc_x; + case yycy: goto yyc_y; + } +/* *********************************** */ +yyc_x: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + YYMTAGP (yyt3); + goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + ; +yy5: + ++YYCURSOR; + YYMTAGP (yyt2); + x = yyt3; + y = yyt2; + YYSETCONDITION(yycz); + ; +/* *********************************** */ +yyc_y: + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR++; + YYSETCONDITION(yycx); + ; +} diff --git a/re2c/test/layout/013_10.ci--tags.re b/re2c/test/layout/013_10.ci--tags.re new file mode 100644 index 00000000..32e43b67 --- /dev/null +++ b/re2c/test/layout/013_10.ci--tags.re @@ -0,0 +1,4 @@ +/*!re2c + #x "a" #y => z := ; +*=>x:=; +*/ \ No newline at end of file diff --git a/re2c/test/layout/__patterns b/re2c/test/layout/__patterns new file mode 100644 index 00000000..2c346938 --- /dev/null +++ b/re2c/test/layout/__patterns @@ -0,0 +1,13 @@ +i--flex-syntax a +i "a" +i ("a") +i--posix-captures ("a") +i [a] +i "a"? +i "a"* +i "a"+ +i "a"{1} +i "a"{1,} +i "a"{1,2} +i--tags @x "a" @y +i--tags #x "a" #y diff --git a/re2c/test/layout/__run.sh b/re2c/test/layout/__run.sh new file mode 100755 index 00000000..88dff526 --- /dev/null +++ b/re2c/test/layout/__run.sh @@ -0,0 +1,84 @@ +#!/bin/bash + +test $# -ne 1 && { echo "usage: ./__run.sh "; exit 1; } +re2c="$1" + + +# code in braces +cat > 000_1.i.re << EOF +/*!re2c + "01" {} + "02" {{{}}} + "03" {"}"} + "04" {'}'} + "05" {/*}*/} + "06" {/*} + */} + "07" {//} + } + *{} +*/ +EOF + + +# condition lists +cat > 000_2.ci.re << EOF +/*!re2c + <*> "01" {} + < * > "02" {} + "03" {} + "04" {} + "05" {} + < x > "06" {} + "07" {} + "08" {} + "09" {} + {} + < ! y> {} + {} + <> {} + <*> * {} +*/ +EOF + + +i=0 +while true; do + + read l || break + i=$((i + 1)) + + # re2c options followed by regexp + IFS=$'\t'; set $l; + test $# -lt 2 && { echo "bad line: $l"; exit 1; } + sfx="$1"; r="$2"; IFS=$' ' + + # generate .re files from __patterns file + f=`printf '%03d' $i` + + printf "/*!re2c\n $r{}\n\t*{\n}\n*/" > ${f}_01.${sfx}.re + printf "/*!re2c\n$r {}\n*\t{\n}\n*/" > ${f}_02.${sfx}.re + printf "/*!re2c\n$r\n{}\n*\n{\n}\n*/" > ${f}_03.${sfx}.re + + printf "/*!re2c\n $r:= ;\n\t*:=;\n*/" > ${f}_04.${sfx}.re + printf "/*!re2c\n$r :=;\n*\t:=\t;\n*/" > ${f}_05.${sfx}.re + printf "/*!re2c\n$r := ;\n ;\n* := ;\n ;\n*/" > ${f}_06.${sfx}.re + + printf "/*!re2c\n $r {}\n< y,x>*{}\n*/" > ${f}_07.c${sfx}.re + printf "/*!re2c\n $r := ;\n*:=;\n*/" > ${f}_08.c${sfx}.re + printf "/*!re2c\n $r => z {}\n*=>x{}\n*/" > ${f}_09.c${sfx}.re + printf "/*!re2c\n $r => z := ;\n*=>x:=;\n*/" > ${f}_10.c${sfx}.re + +done < __patterns + + +# generate .c files from .re files +for f in *.re; do + opts=-`echo $f | sed -E -e 's/[^.]+\.([^.]+)\.re/\1/' -e 's/--/ --/g'` + $re2c $opts $f -W --no-generation-date --no-version -o${f%.re}.c 2>warnings \ + && cat warnings >> ${f%.re}.c && rm warnings \ + || echo "failed on $f" +done + + +echo "all done!" diff --git a/re2c/test/posix_captures/.run/__run.sh b/re2c/test/posix_captures/.run/__run.sh index 37053452..b41a17f0 100755 --- a/re2c/test/posix_captures/.run/__run.sh +++ b/re2c/test/posix_captures/.run/__run.sh @@ -1,7 +1,10 @@ +#!/bin/bash + +test $# -ne 1 && { echo "usage: ./__run.sh "; exit 1; } +re2c="$1" # run [re2c-flags] run() { - re2c="../../../__build/re2c" f="test_"`date +%y%m%d%H%M%S` fail=0 -- 2.40.0