PageRenderTime 37ms CodeModel.GetById 22ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/src/lib/log/conf/log_grammar.e

http://github.com/tybor/Liberty
Specman e | 166 lines | 122 code | 16 blank | 28 comment | 0 complexity | cb14c0c61ec2a85f5ab6ddef2c94f27b MD5 | raw file
  1-- This file is part of a Liberty Eiffel library.
  2-- See the full copyright at the end.
  3--
  4class LOG_GRAMMAR
  5
  6insert
  7   EIFFEL_GRAMMAR
  8      redefine
  9         the_table
 10      end
 11
 12create {LOG_INTERNAL_CONF}
 13   make
 14
 15feature {}
 16   the_table: PARSE_TABLE[DESCENDING_PARSE_CONTEXT]
 17      once
 18         Result := {PARSE_TABLE[DESCENDING_PARSE_CONTEXT] <<
 19                                                            -- Non terminals
 20
 21                                                            "Configuration", {DESCENDING_NON_TERMINAL << {FAST_ARRAY[STRING] << "KW log", "KW configuration",
 22                                                                                                                                "Root", "Outputs", "Loggers",
 23                                                                                                                                "KW end", "KW end of file" >> }, agent build_root(?, ?) >> };
 24                                                            "Root", {DESCENDING_NON_TERMINAL << {FAST_ARRAY[STRING] << "KW root", "KW class name" >> }, Void >> };
 25                                                            "Outputs", {DESCENDING_NON_TERMINAL << {FAST_ARRAY[STRING] << "KW output", "Output*" >> }, Void >> };
 26                                                            "Output*", {DESCENDING_NON_TERMINAL << epsilon, agent build_empty_list("Output*");
 27                                                                                                   {FAST_ARRAY[STRING] << "Output", "Output*" >> }, agent build_continue_list("Output", 0, "Output*");
 28                                                                                                   {FAST_ARRAY[STRING] << "Output", "KW ;", "Output*" >> }, agent build_continue_list("Output", 1, "Output*") >> };
 29                                                            "Output", {DESCENDING_NON_TERMINAL << --{FAST_ARRAY[STRING] << "KW entity name", "KW is", "KW url", "KW string" >> }, Void;
 30                                                                                                  {FAST_ARRAY[STRING] << "KW entity name", "KW is", "KW console", "File_Options" >> }, Void;
 31                                                                                                  {FAST_ARRAY[STRING] << "KW entity name", "KW is", "KW file", "KW string", "File_Options" >> }, Void >> };
 32                                                            "File_Options", {DESCENDING_NON_TERMINAL << epsilon, Void;
 33                                                                                                        {FAST_ARRAY[STRING] << "File_Option+", "KW end" >> }, Void >> };
 34                                                            "File_Option+", {DESCENDING_NON_TERMINAL << {FAST_ARRAY[STRING] << "File_Option" >> }, agent build_new_list("File_Option", "File_Option+");
 35                                                                                                        {FAST_ARRAY[STRING] << "File_Option", "File_Option+" >> }, agent build_continue_list("File_Option", 0, "File_Option+");
 36                                                                                                        {FAST_ARRAY[STRING] << "File_Option", "KW ,", "File_Option+" >> }, agent build_continue_list("File_Option", 1, "File_Option+");
 37                                                                                                        {FAST_ARRAY[STRING] << "File_Option", "KW ;", "File_Option+" >> }, agent build_continue_list("File_Option", 1, "File_Option+"); >> };
 38                                                            "File_Option", {DESCENDING_NON_TERMINAL << {FAST_ARRAY[STRING] << "KW format", "KW string" >> }, Void;
 39                                                                                                       {FAST_ARRAY[STRING] << "KW rotated", "KW each", "Rotation", "Retention" >> }, Void;
 40                                                                                                       {FAST_ARRAY[STRING] << "KW zipped", "KW using", "KW string" >> }, Void >> };
 41                                                            "Rotation", {DESCENDING_NON_TERMINAL << {FAST_ARRAY[STRING] << "KW day" >> }, Void;
 42                                                                                                    {FAST_ARRAY[STRING] << "KW week" >> }, Void;
 43                                                                                                    {FAST_ARRAY[STRING] << "KW month" >> }, Void;
 44                                                                                                    {FAST_ARRAY[STRING] << "KW year" >> }, Void;
 45                                                                                                    {FAST_ARRAY[STRING] << "KW hour" >> }, Void;
 46                                                                                                    {FAST_ARRAY[STRING] << "KW minute" >> }, Void;
 47                                                                                                    {FAST_ARRAY[STRING] << "KW number", "KW days" >> }, Void;
 48                                                                                                    {FAST_ARRAY[STRING] << "KW number", "KW weeks" >> }, Void;
 49                                                                                                    {FAST_ARRAY[STRING] << "KW number", "KW months" >> }, Void;
 50                                                                                                    {FAST_ARRAY[STRING] << "KW number", "KW years" >> }, Void;
 51                                                                                                    {FAST_ARRAY[STRING] << "KW number", "KW hours" >> }, Void;
 52                                                                                                    {FAST_ARRAY[STRING] << "KW number", "KW minutes" >> }, Void;
 53
 54                                                                                                    {FAST_ARRAY[STRING] << "KW byte" >> }, Void;
 55                                                                                                    {FAST_ARRAY[STRING] << "KW kilobyte" >> }, Void;
 56                                                                                                    {FAST_ARRAY[STRING] << "KW megabyte" >> }, Void;
 57                                                                                                    {FAST_ARRAY[STRING] << "KW gigabyte" >> }, Void;
 58                                                                                                    {FAST_ARRAY[STRING] << "KW number", "KW bytes" >> }, Void;
 59                                                                                                    {FAST_ARRAY[STRING] << "KW number", "KW kilobytes" >> }, Void;
 60                                                                                                    {FAST_ARRAY[STRING] << "KW number", "KW megabytes" >> }, Void;
 61                                                                                                    {FAST_ARRAY[STRING] << "KW number", "KW gigabytes" >> }, Void >> };
 62                                                            "Retention", {DESCENDING_NON_TERMINAL << epsilon, Void;
 63                                                                                                     {FAST_ARRAY[STRING] << "KW keeping", "KW number" >> }, Void >> };
 64                                                            "Loggers", {DESCENDING_NON_TERMINAL << {FAST_ARRAY[STRING] << "KW logger", "Logger*" >> }, Void >> };
 65                                                            "Logger*", {DESCENDING_NON_TERMINAL << epsilon, agent build_empty_list("Logger*");
 66                                                                                                   {FAST_ARRAY[STRING] << "Logger", "Logger*" >> }, agent build_continue_list("Logger", 0, "Logger*");
 67                                                                                                   {FAST_ARRAY[STRING] << "Logger", "KW ;", "Logger*" >> }, agent build_continue_list("Logger", 1, "Logger*") >> };
 68                                                            "Logger", {DESCENDING_NON_TERMINAL << {FAST_ARRAY[STRING] << "KW class name", "KW is", "Parent", "Logger_Output",
 69                                                                                                                         "Level", "KW end" >> }, Void >> };
 70                                                            "Parent", {DESCENDING_NON_TERMINAL << epsilon, Void;
 71                                                                                                  {FAST_ARRAY[STRING] << "KW like", "KW class name", "KW with" >> }, Void >> };
 72                                                            "Level", {DESCENDING_NON_TERMINAL << epsilon, Void;
 73                                                                                                 {FAST_ARRAY[STRING] << "KW level", "KW trace" >> }, Void;
 74                                                                                                 {FAST_ARRAY[STRING] << "KW level", "KW info" >> }, Void;
 75                                                                                                 {FAST_ARRAY[STRING] << "KW level", "KW warning" >> }, Void;
 76                                                                                                 {FAST_ARRAY[STRING] << "KW level", "KW error" >> }, Void; >> };
 77                                                            "Logger_Output", {DESCENDING_NON_TERMINAL << epsilon, Void;
 78                                                                                                         {FAST_ARRAY[STRING] << "KW output", "KW entity name" >> }, Void >> };
 79
 80                                                            -- Symbols
 81
 82                                                            "KW ;",             create {DESCENDING_TERMINAL}.make(agent parse_symbol(?, ";", Void), Void);
 83                                                            "KW ,",             create {DESCENDING_TERMINAL}.make(agent parse_symbol(?, ",", Void), Void);
 84
 85                                                            -- Identifiers
 86
 87                                                            "KW class name",    create {DESCENDING_TERMINAL}.make(agent parse_class_name(?), Void);
 88                                                            "KW entity name",   create {DESCENDING_TERMINAL}.make(agent parse_entity_name(?), Void);
 89                                                            "KW string",        create {DESCENDING_TERMINAL}.make(agent parse_string(?), Void);
 90                                                            "KW number",        create {DESCENDING_TERMINAL}.make(agent parse_number(?), Void);
 91
 92                                                            -- Keywords
 93
 94                                                            "KW configuration", create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "configuration"), Void);
 95                                                            "KW console",       create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "console"), Void);
 96                                                            "KW each",          create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "each"), Void);
 97                                                            "KW end",           create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "end"), Void);
 98                                                            "KW end of file",   create {DESCENDING_TERMINAL}.make(agent parse_end(?), Void);
 99                                                            "KW error",         create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "error"), Void);
100                                                            "KW file",          create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "file"), Void);
101                                                            "KW format",        create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "format"), Void);
102                                                            "KW info",          create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "info"), Void);
103                                                            "KW is",            create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "is"), Void);
104                                                            "KW keeping",       create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "keeping"), Void);
105                                                            "KW level",         create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "level"), Void);
106                                                            "KW like",          create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "like"), Void);
107                                                            "KW log",           create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "log"), Void);
108                                                            "KW logger",        create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "logger"), Void);
109                                                            "KW output",        create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "output"), Void);
110                                                            "KW root",          create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "root"), Void);
111                                                            "KW rotated",       create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "rotated"), Void);
112                                                            "KW trace",         create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "trace"), Void);
113                                                            "KW url",           create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "url"), Void); -- reserved but not yet used
114                                                            "KW using",         create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "using"), Void);
115                                                            "KW warning",       create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "warning"), Void);
116                                                            "KW with",          create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "with"), Void);
117                                                            "KW zipped",        create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "zipped"), Void);
118
119                                                            -- Units
120
121                                                            "KW day",        create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "day"), Void);
122                                                            "KW week",       create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "week"), Void);
123                                                            "KW month",      create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "month"), Void);
124                                                            "KW year",       create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "year"), Void);
125                                                            "KW hour",       create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "hour"), Void);
126                                                            "KW minute",     create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "minute"), Void);
127                                                            "KW byte",       create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "byte"), Void);
128                                                            "KW kilobyte",   create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "kilobyte"), Void);
129                                                            "KW megabyte",   create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "megabyte"), Void);
130                                                            "KW gigabyte",   create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "gigabyte"), Void);
131
132                                                            "KW days",       create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "days"), Void);
133                                                            "KW weeks",      create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "weeks"), Void);
134                                                            "KW months",     create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "months"), Void);
135                                                            "KW years",      create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "years"), Void);
136                                                            "KW hours",      create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "hours"), Void);
137                                                            "KW minutes",    create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "minutes"), Void);
138                                                            "KW bytes",      create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "bytes"), Void);
139                                                            "KW kilobytes",  create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "kilobytes"), Void);
140                                                            "KW megabytes",  create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "megabytes"), Void);
141                                                            "KW gigabytes",  create {DESCENDING_TERMINAL}.make(agent parse_keyword(?, "gigabytes"), Void);
142
143                                                            >> }
144      end
145
146end -- class LOG_GRAMMAR
147--
148-- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file.
149--
150-- Permission is hereby granted, free of charge, to any person obtaining a copy
151-- of this software and associated documentation files (the "Software"), to deal
152-- in the Software without restriction, including without limitation the rights
153-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
154-- copies of the Software, and to permit persons to whom the Software is
155-- furnished to do so, subject to the following conditions:
156--
157-- The above copyright notice and this permission notice shall be included in
158-- all copies or substantial portions of the Software.
159--
160-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
161-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
162-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
163-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
164-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
165-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
166-- THE SOFTWARE.