Prexonite, a .NET hosted scripting language with a focus on meta-programming and embedded DSLs
0

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #178 from chklauser/agent/csflex-source-generator

Replace CSFlex tool with source generator

authored by

Christian Klauser and committed by
GitHub
(Jul 11, 2026, 12:31 AM +0200) 53a7c9ac fa189f4a

+18473 -2197
-1
.gitignore
··· 87 87 *.orig 88 88 89 89 # Ignore generated files 90 - # TODO: implement cross-platform CSFlex (Prexonite\Compiler\Lexer.cs) 91 90 PrexoniteTests/OldPrexoniteTests.csproj.xml 92 91 Prexonite/Properties/Resources.Designer.cs 93 92
+2 -2
CLAUDE.md
··· 30 30 31 31 ## Compilation Pipeline 32 32 33 - 1. **Lexical Analysis** (`Compiler/Lexer.cs`) - Generated from `Prexonite.lex` via CSFlex 33 + 1. **Lexical Analysis** - Generated in memory from `Prexonite.lex` by the CSFlex source generator 34 34 2. **Parsing** - Generated from `.atg` `AdditionalFiles` by the PxCoco source generator 35 35 3. **AST Construction** (`Compiler/AST/`) - 50+ node types representing language constructs 36 36 4. **Macro Expansion** (`Compiler/Macro/`) - Compile-time AST transformation (macros run during compilation) ··· 119 119 120 120 - **Grammar Assembly**: `.atg` fragments are ordered and merged in memory by the PxCoco source generator 121 121 - **Parser Generation**: PxCoco emits parser/scanner sources directly into the Roslyn compilation 122 - - **Lexer Generation**: CSFlex generates `Lexer.cs` from `Prexonite.lex` 122 + - **Lexer Generation**: the CSFlex source generator emits the lexer directly into the Roslyn compilation from `Prexonite.lex` 123 123 - **Test fixture generation**: `PrexoniteTests.Generators` generates NUnit fixtures from the JSON test configurations 124 124 125 125 # Meta-Programming Features
+307
CSFlex/COPYRIGHT
··· 1 + C# Flex - Copying, Warranty & License 2 + 3 + 4 + 5 + C# Flex is free software, published under the terms of the GNU General Public License. 6 + 7 + There is absolutely NO WARRANTY for C# Flex, its code and its documentation. 8 + 9 + The code generated by C# Flex inherits the copyright of the specification it 10 + was produced from. If it was your specification, you may use the generated 11 + code without restriction. 12 + 13 + C# Flex is a derivative work of JFlex, the Fast Lexical Analyzer for Java, written 14 + by Gerwin Klein <lsf@jflex.de>. Translation to C# of the program and of the 15 + generated output files was done by Jonathan Gilbert <logic@deltaq.org>. 16 + 17 + 18 + 19 + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 20 + 21 + 22 + 23 + 0. 24 + This License applies to any program or other work which contains 25 + a notice placed by the copyright holder saying it may be distributed 26 + under the terms of this General Public License. The "Program", below, 27 + refers to any such program or work, and a "work based on the Program" 28 + means either the Program or any derivative work under copyright law: 29 + that is to say, a work containing the Program or a portion of it, 30 + either verbatim or with modifications and/or translated into another 31 + language. (Hereinafter, translation is included without limitation in 32 + the term "modification".) Each licensee is addressed as "you". 33 + 34 + 35 + Activities other than copying, distribution and modification are not 36 + covered by this License; they are outside its scope. The act of 37 + running the Program is not restricted, and the output from the Program 38 + is covered only if its contents constitute a work based on the 39 + Program (independent of having been made by running the Program). 40 + Whether that is true depends on what the Program does. 41 + 42 + 43 + 44 + 1. 45 + You may copy and distribute verbatim copies of the Program's 46 + source code as you receive it, in any medium, provided that you 47 + conspicuously and appropriately publish on each copy an appropriate 48 + copyright notice and disclaimer of warranty; keep intact all the 49 + notices that refer to this License and to the absence of any warranty; 50 + and give any other recipients of the Program a copy of this License 51 + along with the Program. 52 + 53 + 54 + You may charge a fee for the physical act of transferring a copy, and 55 + you may at your option offer warranty protection in exchange for a fee. 56 + 57 + 58 + 2. 59 + You may modify your copy or copies of the Program or any portion 60 + of it, thus forming a work based on the Program, and copy and 61 + distribute such modifications or work under the terms of Section 1 62 + above, provided that you also meet all of these conditions: 63 + 64 + 65 + 66 + a) 67 + You must cause the modified files to carry prominent notices 68 + stating that you changed the files and the date of any change. 69 + 70 + 71 + b) 72 + You must cause any work that you distribute or publish, that in 73 + whole or in part contains or is derived from the Program or any 74 + part thereof, to be licensed as a whole at no charge to all third 75 + parties under the terms of this License. 76 + 77 + 78 + c) 79 + If the modified program normally reads commands interactively 80 + when run, you must cause it, when started running for such 81 + interactive use in the most ordinary way, to print or display an 82 + announcement including an appropriate copyright notice and a 83 + notice that there is no warranty (or else, saying that you provide 84 + a warranty) and that users may redistribute the program under 85 + these conditions, and telling the user how to view a copy of this 86 + License. (Exception: if the Program itself is interactive but 87 + does not normally print such an announcement, your work based on 88 + the Program is not required to print an announcement.) 89 + 90 + 91 + These requirements apply to the modified work as a whole. If 92 + identifiable sections of that work are not derived from the Program, 93 + and can be reasonably considered independent and separate works in 94 + themselves, then this License, and its terms, do not apply to those 95 + sections when you distribute them as separate works. But when you 96 + distribute the same sections as part of a whole which is a work based 97 + on the Program, the distribution of the whole must be on the terms of 98 + this License, whose permissions for other licensees extend to the 99 + entire whole, and thus to each and every part regardless of who wrote it. 100 + 101 + 102 + Thus, it is not the intent of this section to claim rights or contest 103 + your rights to work written entirely by you; rather, the intent is to 104 + exercise the right to control the distribution of derivative or 105 + collective works based on the Program. 106 + 107 + 108 + In addition, mere aggregation of another work not based on the Program 109 + with the Program (or with a work based on the Program) on a volume of 110 + a storage or distribution medium does not bring the other work under 111 + the scope of this License. 112 + 113 + 114 + 115 + 3. 116 + You may copy and distribute the Program (or a work based on it, 117 + under Section 2) in object code or executable form under the terms of 118 + Sections 1 and 2 above provided that you also do one of the following: 119 + 120 + 121 + 122 + a) 123 + Accompany it with the complete corresponding machine-readable 124 + source code, which must be distributed under the terms of Sections 125 + 1 and 2 above on a medium customarily used for software interchange; or, 126 + 127 + 128 + b) 129 + Accompany it with a written offer, valid for at least three 130 + years, to give any third party, for a charge no more than your 131 + cost of physically performing source distribution, a complete 132 + machine-readable copy of the corresponding source code, to be 133 + distributed under the terms of Sections 1 and 2 above on a medium 134 + customarily used for software interchange; or, 135 + 136 + 137 + c) 138 + Accompany it with the information you received as to the offer 139 + to distribute corresponding source code. (This alternative is 140 + allowed only for noncommercial distribution and only if you 141 + received the program in object code or executable form with such 142 + an offer, in accord with Subsection b above.) 143 + 144 + 145 + The source code for a work means the preferred form of the work for 146 + making modifications to it. For an executable work, complete source 147 + code means all the source code for all modules it contains, plus any 148 + associated interface definition files, plus the scripts used to 149 + control compilation and installation of the executable. However, as a 150 + special exception, the source code distributed need not include 151 + anything that is normally distributed (in either source or binary 152 + form) with the major components (compiler, kernel, and so on) of the 153 + operating system on which the executable runs, unless that component 154 + itself accompanies the executable. 155 + 156 + 157 + If distribution of executable or object code is made by offering 158 + access to copy from a designated place, then offering equivalent 159 + access to copy the source code from the same place counts as 160 + distribution of the source code, even though third parties are not 161 + compelled to copy the source along with the object code. 162 + 163 + 164 + 4. 165 + You may not copy, modify, sublicense, or distribute the Program 166 + except as expressly provided under this License. Any attempt 167 + otherwise to copy, modify, sublicense or distribute the Program is 168 + void, and will automatically terminate your rights under this License. 169 + However, parties who have received copies, or rights, from you under 170 + this License will not have their licenses terminated so long as such 171 + parties remain in full compliance. 172 + 173 + 174 + 175 + 5. 176 + You are not required to accept this License, since you have not 177 + signed it. However, nothing else grants you permission to modify or 178 + distribute the Program or its derivative works. These actions are 179 + prohibited by law if you do not accept this License. Therefore, by 180 + modifying or distributing the Program (or any work based on the 181 + Program), you indicate your acceptance of this License to do so, and 182 + all its terms and conditions for copying, distributing or modifying 183 + the Program or works based on it. 184 + 185 + 186 + 187 + 6. 188 + Each time you redistribute the Program (or any work based on the 189 + Program), the recipient automatically receives a license from the 190 + original licensor to copy, distribute or modify the Program subject to 191 + these terms and conditions. You may not impose any further 192 + restrictions on the recipients' exercise of the rights granted herein. 193 + You are not responsible for enforcing compliance by third parties to 194 + this License. 195 + 196 + 197 + 198 + 7. 199 + If, as a consequence of a court judgment or allegation of patent 200 + infringement or for any other reason (not limited to patent issues), 201 + conditions are imposed on you (whether by court order, agreement or 202 + otherwise) that contradict the conditions of this License, they do not 203 + excuse you from the conditions of this License. If you cannot 204 + distribute so as to satisfy simultaneously your obligations under this 205 + License and any other pertinent obligations, then as a consequence you 206 + may not distribute the Program at all. For example, if a patent 207 + license would not permit royalty-free redistribution of the Program by 208 + all those who receive copies directly or indirectly through you, then 209 + the only way you could satisfy both it and this License would be to 210 + refrain entirely from distribution of the Program. 211 + 212 + 213 + If any portion of this section is held invalid or unenforceable under 214 + any particular circumstance, the balance of the section is intended to 215 + apply and the section as a whole is intended to apply in other 216 + circumstances. 217 + 218 + 219 + It is not the purpose of this section to induce you to infringe any 220 + patents or other property right claims or to contest validity of any 221 + such claims; this section has the sole purpose of protecting the 222 + integrity of the free software distribution system, which is 223 + implemented by public license practices. Many people have made 224 + generous contributions to the wide range of software distributed 225 + through that system in reliance on consistent application of that 226 + system; it is up to the author/donor to decide if he or she is willing 227 + to distribute software through any other system and a licensee cannot 228 + impose that choice. 229 + 230 + 231 + This section is intended to make thoroughly clear what is believed to 232 + be a consequence of the rest of this License. 233 + 234 + 235 + 236 + 8. 237 + If the distribution and/or use of the Program is restricted in 238 + certain countries either by patents or by copyrighted interfaces, the 239 + original copyright holder who places the Program under this License 240 + may add an explicit geographical distribution limitation excluding 241 + those countries, so that distribution is permitted only in or among 242 + countries not thus excluded. In such case, this License incorporates 243 + the limitation as if written in the body of this License. 244 + 245 + 246 + 247 + 9. 248 + The Free Software Foundation may publish revised and/or new versions 249 + of the General Public License from time to time. Such new versions will 250 + be similar in spirit to the present version, but may differ in detail to 251 + address new problems or concerns. 252 + 253 + 254 + Each version is given a distinguishing version number. If the Program 255 + specifies a version number of this License which applies to it and "any 256 + later version", you have the option of following the terms and conditions 257 + either of that version or of any later version published by the Free 258 + Software Foundation. If the Program does not specify a version number of 259 + this License, you may choose any version ever published by the Free Software 260 + Foundation. 261 + 262 + 263 + 264 + 265 + 10. 266 + If you wish to incorporate parts of the Program into other free 267 + programs whose distribution conditions are different, write to the author 268 + to ask for permission. For software which is copyrighted by the Free 269 + Software Foundation, write to the Free Software Foundation; we sometimes 270 + make exceptions for this. Our decision will be guided by the two goals 271 + of preserving the free status of all derivatives of our free software and 272 + of promoting the sharing and reuse of software generally. 273 + 274 + 275 + 276 + NO WARRANTY 277 + 278 + 279 + 280 + 11. 281 + BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 282 + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 283 + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 284 + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 285 + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 286 + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 287 + TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 288 + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 289 + REPAIR OR CORRECTION. 290 + 291 + 292 + 293 + 12. 294 + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 295 + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 296 + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 297 + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 298 + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 299 + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 300 + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 301 + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 302 + POSSIBILITY OF SUCH DAMAGES. 303 + 304 + 305 + 306 + 307 + END OF TERMS AND CONDITIONS
+34
CSFlex/CSFlex.csproj
··· 1 + <Project Sdk="Microsoft.NET.Sdk"> 2 + 3 + <PropertyGroup> 4 + <TargetFramework>net10.0</TargetFramework> 5 + <IsPackable>false</IsPackable> 6 + <IsRoslynComponent>true</IsRoslynComponent> 7 + <Nullable>disable</Nullable> 8 + <NoWarn>$(NoWarn);SYSLIB0050;CS0618;CS8981</NoWarn> 9 + <Product>CSFlex source generator</Product> 10 + <Company>CSFlex contributors</Company> 11 + <Copyright>Copyright (C) 1998-2005 Gerwin Klein and Jonathan Gilbert; modernized 2026 by the Prexonite contributors</Copyright> 12 + <PackageLicenseFile>COPYRIGHT</PackageLicenseFile> 13 + </PropertyGroup> 14 + 15 + <ItemGroup> 16 + <Reference Include="Microsoft.CodeAnalysis"> 17 + <HintPath>$(MSBuildSDKsPath)/../Roslyn/bincore/Microsoft.CodeAnalysis.dll</HintPath> 18 + <Private>false</Private> 19 + </Reference> 20 + <Reference Include="Microsoft.CodeAnalysis.CSharp"> 21 + <HintPath>$(MSBuildSDKsPath)/../Roslyn/bincore/Microsoft.CodeAnalysis.CSharp.dll</HintPath> 22 + <Private>false</Private> 23 + </Reference> 24 + </ItemGroup> 25 + 26 + <ItemGroup> 27 + <EmbeddedResource Include="Resources/Messages.xml" LogicalName="csflex.Messages.xml" /> 28 + <EmbeddedResource Include="Resources/skeleton.nested" LogicalName="csflex.skeleton.nested" /> 29 + <None Include="COPYRIGHT" Pack="true" PackagePath="" /> 30 + <None Include="CupRuntime/LICENSE" Pack="true" PackagePath="CupRuntime/" /> 31 + <None Include="PROVENANCE.md" Pack="true" PackagePath="" /> 32 + </ItemGroup> 33 + 34 + </Project>
+153
CSFlex/CSFlexGenerator.cs
··· 1 + /* 2 + * CSFlex incremental source-generator wrapper. 3 + * Copyright (C) 2026 Prexonite contributors. 4 + * 5 + * This file is part of the modernized C# Flex port and is distributed under 6 + * GNU GPL version 2. See COPYRIGHT. Generated scanner code is covered by the 7 + * input specification's copyright, as described by the upstream exception. 8 + */ 9 + 10 + using System.Text; 11 + using Microsoft.CodeAnalysis; 12 + using Microsoft.CodeAnalysis.Diagnostics; 13 + using Microsoft.CodeAnalysis.Text; 14 + 15 + namespace CSFlex.Generators; 16 + 17 + [Generator] 18 + public sealed class CSFlexGenerator : IIncrementalGenerator 19 + { 20 + const string OutputMetadata = "build_metadata.AdditionalFiles.CSFlexOutput"; 21 + 22 + static readonly DiagnosticDescriptor InvalidInput = new( 23 + "PRXCSFLEX001", 24 + "Invalid CSFlex input", 25 + "{0}", 26 + "CSFlex", 27 + DiagnosticSeverity.Error, 28 + isEnabledByDefault: true); 29 + 30 + static readonly DiagnosticDescriptor InvalidSpecification = new( 31 + "PRXCSFLEX002", 32 + "Invalid CSFlex specification", 33 + "{0}", 34 + "CSFlex", 35 + DiagnosticSeverity.Error, 36 + isEnabledByDefault: true); 37 + 38 + static readonly DiagnosticDescriptor SpecificationWarning = new( 39 + "PRXCSFLEX003", 40 + "CSFlex specification warning", 41 + "{0}", 42 + "CSFlex", 43 + DiagnosticSeverity.Warning, 44 + isEnabledByDefault: true); 45 + 46 + static readonly DiagnosticDescriptor GenerationFailure = new( 47 + "PRXCSFLEX004", 48 + "CSFlex generation failed", 49 + "{0}", 50 + "CSFlex", 51 + DiagnosticSeverity.Error, 52 + isEnabledByDefault: true); 53 + 54 + public void Initialize(IncrementalGeneratorInitializationContext context) 55 + { 56 + var inputs = context.AdditionalTextsProvider 57 + .Combine(context.AnalyzerConfigOptionsProvider) 58 + .Select(static (pair, cancellationToken) => 59 + ReadInput(pair.Left, pair.Right, cancellationToken)) 60 + .Where(static input => input is not null); 61 + 62 + context.RegisterSourceOutput(inputs, Generate); 63 + } 64 + 65 + static ScannerInput ReadInput( 66 + AdditionalText file, 67 + AnalyzerConfigOptionsProvider optionsProvider, 68 + CancellationToken cancellationToken) 69 + { 70 + var options = optionsProvider.GetOptions(file); 71 + if (!options.TryGetValue(OutputMetadata, out var output) || 72 + string.IsNullOrWhiteSpace(output)) 73 + return null; 74 + 75 + var text = file.GetText(cancellationToken); 76 + return text is null ? null : new ScannerInput(file.Path, output, text); 77 + } 78 + 79 + static void Generate(SourceProductionContext context, ScannerInput input) 80 + { 81 + if (!IsValidHintName(input.Output)) 82 + { 83 + context.ReportDiagnostic(Diagnostic.Create( 84 + InvalidInput, 85 + Location.None, 86 + $"'{input.Output}' is not a valid generated-source hint name.")); 87 + return; 88 + } 89 + 90 + try 91 + { 92 + var result = GeneratorCore.Generate( 93 + input.Text.ToString(), 94 + Path.GetFileName(input.Path)); 95 + foreach (var diagnostic in result.Diagnostics) 96 + { 97 + var descriptor = diagnostic.Severity == GenerationDiagnosticSeverity.Error 98 + ? InvalidSpecification 99 + : SpecificationWarning; 100 + var location = CreateLocation(input, diagnostic.Line, diagnostic.Column); 101 + context.ReportDiagnostic(Diagnostic.Create( 102 + descriptor, 103 + location, 104 + diagnostic.Message)); 105 + } 106 + 107 + if (result.Source is not null) 108 + { 109 + context.AddSource( 110 + input.Output, 111 + SourceText.From(result.Source, Encoding.UTF8)); 112 + } 113 + else if (!result.Diagnostics.Any(static diagnostic => 114 + diagnostic.Severity == GenerationDiagnosticSeverity.Error)) 115 + { 116 + context.ReportDiagnostic(Diagnostic.Create( 117 + GenerationFailure, 118 + Location.None, 119 + $"'{input.Path}' did not produce a scanner.")); 120 + } 121 + } 122 + catch (Exception exception) 123 + { 124 + context.ReportDiagnostic(Diagnostic.Create( 125 + GenerationFailure, 126 + Location.None, 127 + $"'{input.Path}': {exception.Message}")); 128 + } 129 + } 130 + 131 + static bool IsValidHintName(string hintName) => 132 + hintName.EndsWith(".cs", StringComparison.OrdinalIgnoreCase) && 133 + hintName.IndexOfAny(Path.GetInvalidFileNameChars()) < 0 && 134 + !Path.IsPathRooted(hintName); 135 + 136 + static Location CreateLocation(ScannerInput input, int line, int column) 137 + { 138 + if (line < 0 || input.Text.Lines.Count == 0) 139 + return Location.None; 140 + 141 + var lineIndex = Math.Clamp(line, 0, input.Text.Lines.Count - 1); 142 + var textLine = input.Text.Lines[lineIndex]; 143 + var columnIndex = column < 0 ? 0 : Math.Clamp(column, 0, textLine.Span.Length); 144 + var position = textLine.Start + columnIndex; 145 + var point = new LinePosition(lineIndex, columnIndex); 146 + return Location.Create( 147 + input.Path, 148 + new TextSpan(position, 0), 149 + new LinePositionSpan(point, point)); 150 + } 151 + 152 + sealed record ScannerInput(string Path, string Output, SourceText Text); 153 + }
+161
CSFlex/Core/Action.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + 27 + namespace CSFlex 28 + { 29 + 30 + 31 + /** 32 + * Encapsulates an action in the specification. 33 + * 34 + * It stores the Java code as String together with a priority (line number in the specification). 35 + * 36 + * @author Gerwin Klein 37 + * @version JFlex 1.4, $Revision: 2.5 $, $Date: 2004/04/12 10:07:48 $ 38 + * @author Jonathan Gilbert 39 + * @version CSFlex 1.4 40 + */ 41 + sealed public class Action { 42 + 43 + 44 + /** 45 + * The Java code this Action represents 46 + */ 47 + internal String content; 48 + string content_trimmed; 49 + 50 + /** 51 + * The priority (i.e. line number in the specification) of this Action. 52 + */ 53 + internal int priority; 54 + 55 + /** 56 + * True iff the action belongs to an lookahead expresstion 57 + * (<code>a/b</code> or <code>r$</code>) 58 + */ 59 + private bool _isLookAction; 60 + 61 + 62 + /** 63 + * Creates a new Action object with specified content and line number. 64 + * 65 + * @param content java code 66 + * @param priority line number 67 + */ 68 + public Action(String content, int priority) { 69 + this.content = content; 70 + content_trimmed = content.Trim(); 71 + this.priority = priority; 72 + } 73 + 74 + 75 + /** 76 + * Compares the priority value of this Action with the specified action. 77 + * 78 + * @param other the other Action to compare this Action with. 79 + * 80 + * @return this Action if it has higher priority - the specified one, if not. 81 + */ 82 + public Action getHigherPriority(Action other) { 83 + if (other == null) return this; 84 + 85 + // the smaller the number the higher the priority 86 + if (other.priority > this.priority) 87 + return this; 88 + else 89 + return other; 90 + } 91 + 92 + 93 + /** 94 + * Returns the String representation of this object. 95 + * 96 + * @return string representation of the action 97 + */ 98 + public override String ToString() { 99 + return "Action (priority "+priority+", lookahead "+_isLookAction.ToString().ToLower()+") :"+Out.NL+content; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 100 + } 101 + 102 + 103 + /** 104 + * Returns <code>true</code> iff the parameter is an 105 + * Action with the same content as this one. 106 + * 107 + * @param a the object to compare this Action with 108 + * @return true if the action strings are equal 109 + */ 110 + public bool isEquiv(Action a) { 111 + return this == a || ((Options.emit_csharp == false) && this.content_trimmed.Equals(a.content_trimmed)); 112 + } 113 + 114 + 115 + /** 116 + * Calculate hash value. 117 + * 118 + * @return a hash value for this Action 119 + */ 120 + public override int GetHashCode() { 121 + return content_trimmed.GetHashCode(); 122 + } 123 + 124 + 125 + /** 126 + * Test for equality to another object. 127 + * 128 + * This action equals another object if the other 129 + * object is an equivalent action. 130 + * 131 + * @param o the other object. 132 + * 133 + * @see Action#isEquiv(Action) 134 + */ 135 + public override bool Equals(Object o) { 136 + if (o is Action) 137 + return isEquiv((Action) o); 138 + else 139 + return false; 140 + } 141 + 142 + /** 143 + * Return look ahead flag. 144 + * 145 + * @return true if this actions belongs to a lookahead rule 146 + */ 147 + public bool isLookAction() { 148 + return _isLookAction; 149 + } 150 + 151 + /** 152 + * Sets the look ahead flag for this action 153 + * 154 + * @param b set to true if this action belongs to a look ahead rule 155 + */ 156 + public void setLookAction(bool b) { 157 + _isLookAction = b; 158 + } 159 + 160 + } 161 + }
+58
CSFlex/Core/CharClassException.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + 27 + namespace CSFlex 28 + { 29 + 30 + 31 + 32 + /** 33 + * This Exception is used in class CharClasses. 34 + * 35 + * @author Gerwin Klein 36 + * @version JFlex 1.4, $Revision: 2.1 $, $Date: 2004/04/12 10:07:47 $ 37 + * @author Jonathan Gilbert 38 + * @version CSFlex 1.4 39 + */ 40 + public class CharClassException: RuntimeException { 41 + 42 + /** 43 + * Creates a new CharClassException without message 44 + */ 45 + public CharClassException() { 46 + } 47 + 48 + 49 + /** 50 + * Creates a new CharClassException with the specified message 51 + * 52 + * @param message the error description presented to the user. 53 + */ 54 + public CharClassException(String message) : base(message) { 55 + } 56 + 57 + } 58 + }
+83
CSFlex/Core/CharClassInterval.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + 27 + namespace CSFlex 28 + { 29 + 30 + /** 31 + * Stores an interval of characters together with the character class 32 + * 33 + * A character belongs to an interval, if its Unicode value is greater than or equal 34 + * to the Unicode value of <CODE>start</code> and smaller than or euqal to the Unicode 35 + * value of <CODE>end</code>. 36 + * 37 + * All characters of the interval must belong to the same character class. 38 + * 39 + * @author Gerwin Klein 40 + * @version JFlex 1.4, $Revision: 2.2 $, $Date: 2004/04/12 10:07:48 $ 41 + * @author Jonathan Gilbert 42 + * @version CSFlex 1.4 43 + */ 44 + public class CharClassInterval { 45 + 46 + /** 47 + * The first character of the interval 48 + */ 49 + internal int start; 50 + 51 + /** 52 + * The last character of the interval 53 + */ 54 + internal int end; 55 + 56 + /** 57 + * The code of the class all characters of this interval belong to. 58 + */ 59 + internal int charClass; 60 + 61 + 62 + /** 63 + * Creates a new CharClassInterval from <CODE>start</code> to <CODE>end</code> 64 + * that belongs to character class <CODE>charClass</code>. 65 + * 66 + * @param start The first character of the interval 67 + * @param end The last character of the interval 68 + * @param charClass The code of the class all characters of this interval belong to. 69 + */ 70 + public CharClassInterval(int start, int end, int charClass) { 71 + this.start = start; 72 + this.end = end; 73 + this.charClass = charClass; 74 + } 75 + 76 + /** 77 + * returns string representation of this class interval 78 + */ 79 + public override String ToString() { 80 + return "["+start+"-"+end+"="+charClass+"]"; 81 + } 82 + } 83 + }
+403
CSFlex/Core/CharClasses.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + using System.Collections; 27 + using System.Text; 28 + 29 + namespace CSFlex 30 + { 31 + 32 + /** 33 + * 34 + * @author Gerwin Klein 35 + * @version JFlex 1.4, $Revision: 2.5 $, $Date: 2004/04/12 10:07:47 $ 36 + * @author Jonathan Gilbert 37 + * @version CSFlex 1.4 38 + */ 39 + public class CharClasses { 40 + 41 + /** debug flag (for char classes only) */ 42 + private static readonly bool DEBUG = false; 43 + 44 + /** the largest character that can be used in char classes */ 45 + public const char maxChar = '\uFFFF'; 46 + 47 + /** the char classes */ 48 + private ArrayList /* of IntCharSet */ classes; 49 + 50 + /** the largest character actually used in a specification */ 51 + private char maxCharUsed; 52 + 53 + /** 54 + * Constructs a new CharClass object that provides space for 55 + * classes of characters from 0 to maxCharCode. 56 + * 57 + * Initially all characters are in class 0. 58 + * 59 + * @param maxCharCode the last character code to be 60 + * considered. (127 for 7bit Lexers, 61 + * 255 for 8bit Lexers and 0xFFFF 62 + * for Unicode Lexers). 63 + */ 64 + public CharClasses(int maxCharCode) { 65 + if (maxCharCode < 0 || maxCharCode > 0xFFFF) 66 + throw new ArgumentException(); 67 + 68 + maxCharUsed = (char) maxCharCode; 69 + 70 + classes = new PrettyArrayList(); 71 + classes.Add(new IntCharSet(new Interval((char) 0, maxChar))); 72 + } 73 + 74 + 75 + /** 76 + * Returns the greatest Unicode value of the current input character set. 77 + */ 78 + public char getMaxCharCode() { 79 + return maxCharUsed; 80 + } 81 + 82 + 83 + /** 84 + * Sets the larges Unicode value of the current input character set. 85 + * 86 + * @param charCode the largest character code, used for the scanner 87 + * (i.e. %7bit, %8bit, %16bit etc.) 88 + */ 89 + public void setMaxCharCode(int charCode) { 90 + if (charCode < 0 || charCode > 0xFFFF) 91 + throw new ArgumentException(); 92 + 93 + maxCharUsed = (char) charCode; 94 + } 95 + 96 + 97 + /** 98 + * Returns the current number of character classes. 99 + */ 100 + public int getNumClasses() { 101 + return classes.Count; 102 + } 103 + 104 + 105 + 106 + /** 107 + * Updates the current partition, so that the specified set of characters 108 + * gets a new character class. 109 + * 110 + * Characters that are elements of <code>set</code> are not in the same 111 + * equivalence class with characters that are not elements of <code>set</code>. 112 + * 113 + * @param set the set of characters to distinguish from the rest 114 + * @param caseless if true upper/lower/title case are considered equivalent 115 + */ 116 + public void makeClass(IntCharSet set, bool caseless) { 117 + if (caseless) set = set.getCaseless(); 118 + 119 + if ( DEBUG ) { 120 + Out.dump("makeClass("+set+")"); 121 + dump(); 122 + } 123 + 124 + try 125 + { 126 + int oldSize = classes.Count; 127 + for (int i = 0; i < oldSize; i++) 128 + { 129 + IntCharSet x = (IntCharSet) classes[i]; 130 + 131 + if (x.Equals(set)) return; 132 + 133 + IntCharSet and = x.and(set); 134 + 135 + if ( and.containsElements() ) 136 + { 137 + if ( x.Equals(and) ) 138 + { 139 + set.sub(and); 140 + continue; 141 + } 142 + else if ( set.Equals(and) ) 143 + { 144 + x.sub(and); 145 + classes.Add(and); 146 + return; 147 + } 148 + 149 + set.sub(and); 150 + x.sub(and); 151 + classes.Add(and); 152 + } 153 + } 154 + } 155 + finally 156 + { 157 + if (DEBUG) 158 + { 159 + Out.dump("makeClass(..) finished"); 160 + dump(); 161 + } 162 + } 163 + } 164 + 165 + 166 + /** 167 + * Returns the code of the character class the specified character belongs to. 168 + */ 169 + public int getClassCode(char letter) { 170 + int i = -1; 171 + while (true) { 172 + IntCharSet x = (IntCharSet) classes[++i]; 173 + if ( x.contains(letter) ) return i; 174 + } 175 + } 176 + 177 + /** 178 + * Dump charclasses to the dump output stream 179 + */ 180 + public void dump() { 181 + Out.dump(ToString()); 182 + } 183 + 184 + 185 + /** 186 + * Return a string representation of one char class 187 + * 188 + * @param theClass the index of the class to 189 + */ 190 + public String ToString(int theClass) { 191 + return classes[theClass].ToString(); 192 + } 193 + 194 + 195 + /** 196 + * Return a string representation of the char classes 197 + * stored in this class. 198 + * 199 + * Enumerates the classes by index. 200 + */ 201 + public override String ToString() { 202 + StringBuilder result = new StringBuilder("CharClasses:"); 203 + 204 + result.Append(Out.NL); 205 + 206 + for (int i = 0; i < classes.Count; i++) 207 + result.AppendFormat("class {1}:{0}{2}{0}", Out.NL, i, classes[i]); 208 + 209 + return result.ToString(); 210 + } 211 + 212 + 213 + /** 214 + * Creates a new character class for the single character <code>singleChar</code>. 215 + * 216 + * @param caseless if true upper/lower/title case are considered equivalent 217 + */ 218 + public void makeClass(char singleChar, bool caseless) { 219 + makeClass(new IntCharSet(singleChar), caseless); 220 + } 221 + 222 + 223 + /** 224 + * Creates a new character class for each character of the specified String. 225 + * 226 + * @param caseless if true upper/lower/title case are considered equivalent 227 + */ 228 + public void makeClass(String str, bool caseless) { 229 + for (int i = 0; i < str.Length; i++) makeClass(str[i], caseless); 230 + } 231 + 232 + 233 + /** 234 + * Updates the current partition, so that the specified set of characters 235 + * gets a new character class. 236 + * 237 + * Characters that are elements of the set <code>v</code> are not in the same 238 + * equivalence class with characters that are not elements of the set <code>v</code>. 239 + * 240 + * @param v a Vector of Interval objects. 241 + * This Vector represents a set of characters. The set of characters is 242 + * the union of all intervalls in the Vector. 243 + * 244 + * @param caseless if true upper/lower/title case are considered equivalent 245 + */ 246 + public void makeClass(ArrayList /* Interval */ v, bool caseless) { 247 + makeClass(new IntCharSet(v), caseless); 248 + } 249 + 250 + 251 + /** 252 + * Updates the current partition, so that the set of all characters not contained in the specified 253 + * set of characters gets a new character class. 254 + * 255 + * Characters that are elements of the set <code>v</code> are not in the same 256 + * equivalence class with characters that are not elements of the set <code>v</code>. 257 + * 258 + * This method is equivalent to <code>makeClass(v)</code> 259 + * 260 + * @param v a Vector of Interval objects. 261 + * This Vector represents a set of characters. The set of characters is 262 + * the union of all intervalls in the Vector. 263 + * 264 + * @param caseless if true upper/lower/title case are considered equivalent 265 + */ 266 + public void makeClassNot(ArrayList v, bool caseless) { 267 + makeClass(new IntCharSet(v), caseless); 268 + } 269 + 270 + 271 + /** 272 + * Returns an array that contains the character class codes of all characters 273 + * in the specified set of input characters. 274 + */ 275 + private int [] getClassCodes(IntCharSet set, bool negate) { 276 + 277 + if (DEBUG) { 278 + Out.dump("getting class codes for "+set); 279 + if (negate) 280 + Out.dump("[negated]"); 281 + } 282 + 283 + int size = classes.Count; 284 + 285 + // [fixme: optimize] 286 + int[] temp = new int [size]; 287 + int length = 0; 288 + 289 + for (int i = 0; i < size; i++) { 290 + IntCharSet x = (IntCharSet) classes[i]; 291 + if ( negate ) { 292 + if ( !set.and(x).containsElements() ) { 293 + temp[length++] = i; 294 + if (DEBUG) Out.dump("code "+i); 295 + } 296 + } 297 + else { 298 + if ( set.and(x).containsElements() ) { 299 + temp[length++] = i; 300 + if (DEBUG) Out.dump("code "+i); 301 + } 302 + } 303 + } 304 + 305 + int[] result = new int [length]; 306 + Array.Copy(temp, 0, result, 0, length); 307 + 308 + return result; 309 + } 310 + 311 + 312 + /** 313 + * Returns an array that contains the character class codes of all characters 314 + * in the specified set of input characters. 315 + * 316 + * @param intervallVec a Vector of Intervalls, the set of characters to get 317 + * the class codes for 318 + * 319 + * @return an array with the class codes for intervallVec 320 + */ 321 + public int [] getClassCodes(ArrayList /* Interval */ intervallVec) { 322 + return getClassCodes(new IntCharSet(intervallVec), false); 323 + } 324 + 325 + 326 + /** 327 + * Returns an array that contains the character class codes of all characters 328 + * that are <strong>not</strong> in the specified set of input characters. 329 + * 330 + * @param intervallVec a Vector of Intervalls, the complement of the 331 + * set of characters to get the class codes for 332 + * 333 + * @return an array with the class codes for the complement of intervallVec 334 + */ 335 + public int [] getNotClassCodes(ArrayList /* Interval */ intervallVec) { 336 + return getClassCodes(new IntCharSet(intervallVec), true); 337 + } 338 + 339 + 340 + /** 341 + * Check consistency of the stored classes [debug]. 342 + * 343 + * all classes must be disjoint, checks if all characters 344 + * have a class assigned. 345 + */ 346 + public void check() { 347 + for (int i = 0; i < classes.Count; i++) 348 + for (int j = i+1; j < classes.Count; j++) { 349 + IntCharSet x = (IntCharSet) classes[i]; 350 + IntCharSet y = (IntCharSet) classes[j]; 351 + if ( x.and(y).containsElements() ) { 352 + Console.WriteLine("Error: non disjoint char classes {0} and {1}", i, j); 353 + Console.WriteLine("class {0}: {1}", i, x); 354 + Console.WriteLine("class {0}: {1}", j, y); 355 + } 356 + } 357 + 358 + // check if each character has a classcode 359 + // (= if getClassCode terminates) 360 + for (char c = (char)0; c < maxChar; c++) { 361 + getClassCode(c); 362 + if (c % 100 == 0) Console.Write("."); 363 + } 364 + 365 + getClassCode(maxChar); 366 + } 367 + 368 + 369 + /** 370 + * Returns an array of all CharClassIntervalls in this 371 + * char class collection. 372 + * 373 + * The array is ordered by char code, i.e. 374 + * <code>result[i+1].start = result[i].end+1</code> 375 + * 376 + * Each CharClassInterval contains the number of the 377 + * char class it belongs to. 378 + */ 379 + public CharClassInterval [] getIntervalls() { 380 + int i, c; 381 + int size = classes.Count; 382 + int numIntervalls = 0; 383 + 384 + for (i = 0; i < size; i++) 385 + numIntervalls+= ((IntCharSet) classes[i]).numIntervalls(); 386 + 387 + CharClassInterval [] result = new CharClassInterval[numIntervalls]; 388 + 389 + i = 0; 390 + c = 0; 391 + while (i < numIntervalls) { 392 + int code = getClassCode((char) c); 393 + IntCharSet set = (IntCharSet) classes[code]; 394 + Interval iv = set.getNext(); 395 + 396 + result[i++] = new CharClassInterval(iv.start, iv.end, code); 397 + c = iv.end+1; 398 + } 399 + 400 + return result; 401 + } 402 + } 403 + }
+123
CSFlex/Core/CharSet.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + using System.Text; 27 + 28 + namespace CSFlex 29 + { 30 + 31 + 32 + /** 33 + * 34 + * @author Gerwin Klein 35 + * @version JFlex 1.4, $Revision: 2.1 $, $Date: 2004/04/12 10:07:47 $ 36 + * @author Jonathan Gilbert 37 + * @version CSFlex 1.4 38 + */ 39 + public sealed class CharSet { 40 + 41 + internal const int BITS = 6; // the number of bits to shift (2^6 = 64) 42 + internal const int MOD = (1<<BITS)-1; // modulus 43 + 44 + internal long[] bits; 45 + 46 + private int numElements; 47 + 48 + 49 + public CharSet() { 50 + bits = new long[1]; 51 + } 52 + 53 + 54 + public CharSet(int initialSize, int character) { 55 + bits = new long[(initialSize >> BITS)+1]; 56 + add(character); 57 + } 58 + 59 + 60 + public void add(int character) { 61 + resize(character); 62 + 63 + if ( (bits[character >> BITS] & (1L << (character & MOD))) == 0) numElements++; 64 + 65 + bits[character >> BITS] |= (1L << (character & MOD)); 66 + } 67 + 68 + 69 + private int nbits2size (int nbits) { 70 + return ((nbits >> BITS) + 1); 71 + } 72 + 73 + 74 + private void resize(int nbits) { 75 + int needed = nbits2size(nbits); 76 + 77 + if (needed < bits.Length) return; 78 + 79 + long[] newbits = new long[Math.Max(bits.Length*2,needed)]; 80 + Array.Copy(bits, 0, newbits, 0, bits.Length); 81 + 82 + bits = newbits; 83 + } 84 + 85 + 86 + public bool isElement(int character) { 87 + int index = character >> BITS; 88 + if (index >= bits.Length) return false; 89 + return (bits[index] & (1L << (character & MOD))) != 0; 90 + } 91 + 92 + 93 + public CharSetEnumerator characters() { 94 + return new CharSetEnumerator(this); 95 + } 96 + 97 + 98 + public bool containsElements() { 99 + return numElements > 0; 100 + } 101 + 102 + public int size() { 103 + return numElements; 104 + } 105 + 106 + public override String ToString() { 107 + CharSetEnumerator @enum = characters(); 108 + 109 + StringBuilder result = new StringBuilder("{"); 110 + 111 + if ( @enum.hasMoreElements() ) result.Append(@enum.nextElement()); 112 + 113 + while ( @enum.hasMoreElements() ) { 114 + int i = @enum.nextElement(); 115 + result.Append(", ").Append(i); 116 + } 117 + 118 + result.Append("}"); 119 + 120 + return result.ToString(); 121 + } 122 + } 123 + }
+96
CSFlex/Core/CharSetEnumerator.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + namespace CSFlex 26 + { 27 + 28 + 29 + /** 30 + * Enumerator for the elements of a CharSet. 31 + * 32 + * Does not implement java.util.Enumeration, but supports the same protocol. 33 + * 34 + * @author Gerwin Klein 35 + * @version JFlex 1.4, $Revision: 2.2 $, $Date: 2004/04/12 10:07:47 $ 36 + * @author Jonathan Gilbert 37 + * @version CSFlex 1.4 38 + */ 39 + sealed public class CharSetEnumerator { 40 + 41 + private int index; 42 + private int offset; 43 + private long mask = 1; 44 + 45 + private CharSet set; 46 + 47 + public CharSetEnumerator(CharSet characters) { 48 + set = characters; 49 + 50 + while (index < set.bits.Length && set.bits[index] == 0) 51 + index++; 52 + 53 + if (index >= set.bits.Length) return; 54 + 55 + while (offset <= CharSet.MOD && ((set.bits[index] & mask) == 0)) { 56 + mask<<= 1; 57 + offset++; 58 + } 59 + } 60 + 61 + private void advance() { 62 + do { 63 + offset++; 64 + mask<<= 1; 65 + } while (offset <= CharSet.MOD && ((set.bits[index] & mask) == 0)); 66 + 67 + if (offset > CharSet.MOD) { 68 + do 69 + index++; 70 + while (index < set.bits.Length && set.bits[index] == 0); 71 + 72 + if (index >= set.bits.Length) return; 73 + 74 + offset = 0; 75 + mask = 1; 76 + 77 + while (offset <= CharSet.MOD && ((set.bits[index] & mask) == 0)) { 78 + mask<<= 1; 79 + offset++; 80 + } 81 + } 82 + } 83 + 84 + public bool hasMoreElements() { 85 + return index < set.bits.Length; 86 + } 87 + 88 + public int nextElement() { 89 + int x = (index << CharSet.BITS) + offset; 90 + advance(); 91 + return x; 92 + } 93 + 94 + } 95 + 96 + }
+151
CSFlex/Core/CountEmitter.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + 27 + namespace CSFlex 28 + { 29 + 30 + /** 31 + * An emitter for an array encoded as count/value pairs in a string. 32 + * 33 + * @author Gerwin Klein 34 + * @version $Revision: 1.6 $, $Date: 2004/04/12 10:07:48 $ 35 + */ 36 + public class CountEmitter: PackEmitter { 37 + /** number of entries in expanded array */ 38 + private int numEntries; 39 + 40 + /** translate all values by this amount */ 41 + private int translate = 0; 42 + 43 + 44 + /** 45 + * Create a count/value emitter for a specific field. 46 + * 47 + * @param name name of the generated array 48 + */ 49 + protected internal CountEmitter(String name): base(name) { 50 + } 51 + 52 + /** 53 + * Emits count/value unpacking code for the generated array. 54 + * 55 + * @see CSFlex.PackEmitter#emitUnPack() 56 + */ 57 + public override void emitUnpack() { 58 + if (Options.emit_csharp) 59 + println(" 0 };"); // close array 60 + else 61 + println("\";"); // close last string chunk: 62 + 63 + nl(); 64 + println(" private static int [] zzUnpack"+name+"() {"); 65 + println(" int [] result = new int["+numEntries+"];"); 66 + println(" int offset = 0;"); 67 + 68 + for (int i = 0; i < chunks; i++) { 69 + println(" offset = zzUnpack"+name+"("+constName()+"_PACKED_"+i+", offset, result);"); 70 + } 71 + 72 + println(" return result;"); 73 + println(" }"); 74 + nl(); 75 + 76 + if (Options.emit_csharp) 77 + { 78 + println(" private static int zzUnpack"+name+"(ushort[] packed, int offset, int [] result) {"); 79 + println(" int i = 0; /* index in packed string */"); 80 + println(" int j = offset; /* index in unpacked array */"); 81 + println(" int l = packed.Length;"); 82 + println(" while (i + 1 < l) {"); 83 + println(" int count = packed[i++];"); 84 + println(" int value = packed[i++];"); 85 + if (translate == 1) 86 + { 87 + println(" value--;"); 88 + } 89 + else if (translate != 0) 90 + { 91 + println(" value-= "+translate); 92 + } 93 + println(" do result[j++] = value; while (--count > 0);"); 94 + println(" }"); 95 + println(" return j;"); 96 + println(" }"); 97 + } 98 + else 99 + { 100 + println(" private static int zzUnpack"+name+"(String packed, int offset, int [] result) {"); 101 + println(" int i = 0; /* index in packed string */"); 102 + println(" int j = offset; /* index in unpacked array */"); 103 + println(" int l = packed.length();"); 104 + println(" while (i < l) {"); 105 + println(" int count = packed.charAt(i++);"); 106 + println(" int value = packed.charAt(i++);"); 107 + if (translate == 1) 108 + { 109 + println(" value--;"); 110 + } 111 + else if (translate != 0) 112 + { 113 + println(" value-= "+translate); 114 + } 115 + println(" do result[j++] = value; while (--count > 0);"); 116 + println(" }"); 117 + println(" return j;"); 118 + println(" }"); 119 + } 120 + } 121 + 122 + /** 123 + * Translate all values by given amount. 124 + * 125 + * Use to move value interval from [0, 0xFFFF] to something different. 126 + * 127 + * @param i amount the value will be translated by. 128 + * Example: <code>i = 1</code> allows values in [-1, 0xFFFE]. 129 + */ 130 + public void setValTranslation(int i) { 131 + this.translate = i; 132 + } 133 + 134 + /** 135 + * Emit one count/value pair. 136 + * 137 + * Automatically translates value by the <code>translate</code> value. 138 + * 139 + * @param count 140 + * @param value 141 + * 142 + * @see CountEmitter#setValTranslation(int) 143 + */ 144 + public void emit(int count, int value) { 145 + numEntries+= count; 146 + breaks(); 147 + emitUC(count); 148 + emitUC(value+translate); 149 + } 150 + } 151 + }
+971
CSFlex/Core/DFA.cs
··· 1 + // #define DEBUG_TRACE 2 + 3 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 4 + * C# Flex 1.4 * 5 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 6 + * Derived from: * 7 + * * 8 + * JFlex 1.4 * 9 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 10 + * All rights reserved. * 11 + * * 12 + * This program is free software; you can redistribute it and/or modify * 13 + * it under the terms of the GNU General Public License. See the file * 14 + * COPYRIGHT for more information. * 15 + * * 16 + * This program is distributed in the hope that it will be useful, * 17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 19 + * GNU General Public License for more details. * 20 + * * 21 + * You should have received a copy of the GNU General Public License along * 22 + * with this program; if not, write to the Free Software Foundation, Inc., * 23 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 24 + * * 25 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 26 + 27 + using System; 28 + using System.Collections; 29 + using System.IO; 30 + using System.Text; 31 + 32 + namespace CSFlex 33 + { 34 + 35 + 36 + /** 37 + * DFA representation in C# Flex. 38 + * Contains minimization algorithm. 39 + * 40 + * @author Gerwin Klein 41 + * @version JFlex 1.4, $Revision: 2.6 $, $Date: 2004/04/12 10:07:48 $ 42 + * @author Jonathan Gilbert 43 + * @version CSFlex 1.4 44 + */ 45 + sealed public class DFA { 46 + 47 + /** 48 + * The initial number of states 49 + */ 50 + private const int STATES = 500; 51 + 52 + /** 53 + * The code for "no target state" in the transition table. 54 + */ 55 + public const int NO_TARGET = -1; 56 + 57 + /** 58 + * table[current_state][character] is the next state for <code>current_state</code> 59 + * with input <code>character</code>, <code>NO_TARGET</code> if there is no transition for 60 + * this input in <code>current_state</code> 61 + */ 62 + internal int [][] table; 63 + 64 + 65 + /** 66 + * <code>isFinal[state] == true</code> <=> the state <code>state</code> is 67 + * a final state. 68 + */ 69 + internal bool[] isFinal; 70 + 71 + /** 72 + * <code>isPushback[state] == true</code> <=> the state <code>state</code> is 73 + * a final state of an expression that can only be matched when followed by 74 + * a certain lookaead. 75 + */ 76 + internal bool[] isPushback; 77 + 78 + 79 + /** 80 + * <code>isLookEnd[state] == true</code> <=> the state <code>state</code> is 81 + * a final state of a lookahead expression. 82 + */ 83 + internal bool[] isLookEnd; 84 + 85 + 86 + /** 87 + * <code>action[state]</code> is the action that is to be carried out in 88 + * state <code>state</code>, <code>null</code> if there is no action. 89 + */ 90 + internal Action [] action; 91 + 92 + /** 93 + * lexState[i] is the start-state of lexical state i 94 + */ 95 + internal int[] lexState; 96 + 97 + /** 98 + * The number of states in this DFA 99 + */ 100 + internal int numStates; 101 + 102 + 103 + /** 104 + * The current maximum number of input characters 105 + */ 106 + internal int numInput; 107 + 108 + 109 + /** 110 + * all actions that are used in this DFA 111 + */ 112 + private Hashtable usedActions = new PrettyHashtable(); 113 + 114 + #if DEBUG_TRACE 115 + System.IO.StreamWriter log = new StreamWriter(@"x:\dfa_csharp.log"); 116 + #endif // DEBUG_TRACE 117 + 118 + public DFA(int numLexStates, int numInp) { 119 + #if DEBUG_TRACE 120 + log.AutoFlush = true; 121 + log.WriteLine("new DFA(int numLexStates = {0}, int numInp = {1})", numLexStates, numInp); 122 + #endif // DEBUG_TRACE 123 + 124 + numInput = numInp; 125 + 126 + int statesNeeded = Math.Max(numLexStates, STATES); 127 + 128 + table = new int [statesNeeded][]; 129 + for (int i=0; i < table.Length; i++) 130 + table[i] = new int[numInput]; 131 + action = new Action [statesNeeded]; 132 + isFinal = new bool[statesNeeded]; 133 + isPushback = new bool[statesNeeded]; 134 + isLookEnd = new bool[statesNeeded]; 135 + lexState = new int [numLexStates]; 136 + numStates = 0; 137 + 138 + for (int i = 0; i < statesNeeded; i++) { 139 + for (char j = (char)0; j < numInput; j++) 140 + table [i][j] = NO_TARGET; 141 + } 142 + } 143 + 144 + 145 + public void setLexState(int lState, int trueState) { 146 + lexState[lState] = trueState; 147 + } 148 + 149 + private void ensureStateCapacity(int newNumStates) { 150 + int oldLength = isFinal.Length; 151 + 152 + if ( newNumStates < oldLength ) return; 153 + 154 + int newLength = oldLength*2; 155 + while ( newLength <= newNumStates ) newLength*= 2; 156 + 157 + bool [] newFinal = new bool [newLength]; 158 + bool [] newPushback = new bool [newLength]; 159 + bool [] newLookEnd = new bool [newLength]; 160 + Action [] newAction = new Action [newLength]; 161 + int [] [] newTable = new int [newLength] []; 162 + for (int idx=0; idx < newTable.Length; idx++) 163 + newTable[idx] = new int [numInput]; 164 + 165 + Array.Copy(isFinal,0,newFinal,0,numStates); 166 + Array.Copy(isPushback,0,newPushback,0,numStates); 167 + Array.Copy(isLookEnd,0,newLookEnd,0,numStates); 168 + Array.Copy(action,0,newAction,0,numStates); 169 + Array.Copy(table,0,newTable,0,oldLength); 170 + 171 + int i,j; 172 + 173 + for (i = oldLength; i < newLength; i++) { 174 + for (j = 0; j < numInput; j++) { 175 + newTable[i][j] = NO_TARGET; 176 + } 177 + } 178 + 179 + isFinal = newFinal; 180 + isPushback = newPushback; 181 + isLookEnd = newLookEnd; 182 + action = newAction; 183 + table = newTable; 184 + } 185 + 186 + 187 + public void setAction(int state, Action stateAction) { 188 + #if DEBUG_TRACE 189 + log.WriteLine("setAction(int state = {0}, Action stateAction = {1})", state, stateAction); 190 + #endif // DEBUG_TRACE 191 + 192 + action[state] = stateAction; 193 + if (stateAction != null) { 194 + isLookEnd[state] = stateAction.isLookAction(); 195 + usedActions[stateAction] = stateAction; 196 + #if DEBUG_TRACE 197 + log.WriteLine(" new usedActions size: {0} entries", usedActions.Count); 198 + #endif // DEBUG_TRACE 199 + } 200 + } 201 + 202 + public void setFinal(int state, bool isFinalState) { 203 + isFinal[state] = isFinalState; 204 + } 205 + 206 + public void setPushback(int state, bool isPushbackState) { 207 + isPushback[state] = isPushbackState; 208 + } 209 + 210 + 211 + public void addTransition(int start, char input, int dest) { 212 + int max = Math.Max(start,dest)+1; 213 + ensureStateCapacity(max); 214 + if (max > numStates) numStates = max; 215 + 216 + // Out.debug("Adding DFA transition ("+start+", "+(int)input+", "+dest+")"); 217 + 218 + table[start][input] = dest; 219 + } 220 + 221 + 222 + 223 + public override String ToString() { 224 + StringBuilder result = new StringBuilder(); 225 + 226 + for (int i=0; i < numStates; i++) { 227 + result.Append("State "); 228 + if ( isFinal[i] ) result.Append("[FINAL] "); // (action "+action[i].priority+")] "); 229 + if ( isPushback[i] ) result.Append("[PUSH] "); 230 + result.Append(i).Append(":").Append(Out.NL); 231 + 232 + for (char j=(char)0; j < numInput; j++) { 233 + if ( table[i][j] >= 0 ) 234 + result.Append(" with ").Append((int)j) 235 + .Append(" in ").Append(table[i][j]).Append(Out.NL); 236 + } 237 + } 238 + 239 + return result.ToString(); 240 + } 241 + 242 + 243 + public void writeDot(File file) { 244 + try { 245 + StreamWriter writer = new StreamWriter(file); 246 + writer.WriteLine(dotFormat()); 247 + writer.Close(); 248 + } 249 + catch (IOException) { 250 + Out.error(ErrorMessages.FILE_WRITE, file); 251 + throw new GeneratorException(); 252 + } 253 + } 254 + 255 + 256 + public String dotFormat() { 257 + StringBuilder result = new StringBuilder(); 258 + 259 + result.Append("digraph DFA {").Append(Out.NL); 260 + result.Append("rankdir = LR").Append(Out.NL); 261 + 262 + for (int i=0; i < numStates; i++) { 263 + if ( isFinal[i] || isPushback[i] ) result.Append(i); 264 + if ( isFinal[i] ) result.Append(" [shape = doublecircle]"); 265 + if ( isPushback[i] ) result.Append(" [shape = box]"); 266 + if ( isFinal[i] || isPushback[i] ) result.Append(Out.NL); 267 + } 268 + 269 + for (int i=0; i < numStates; i++) { 270 + for (int input = 0; input < numInput; input++) { 271 + if ( table[i][input] >= 0 ) { 272 + result.Append(i).Append(" -> ").Append(table[i][input]); 273 + result.Append(" [label=\"[").Append(input).Append("]\"]").Append(Out.NL); 274 + // result.append(" [label=\"["+classes.toString(input)+"]\"]\n"); 275 + } 276 + } 277 + } 278 + 279 + result.Append("}").Append(Out.NL); 280 + 281 + return result.ToString(); 282 + } 283 + 284 + 285 + // check if all actions can actually be matched in this DFA 286 + public void checkActions(LexScan scanner, LexParse parser) { 287 + EOFActions eofActions = parser.getEOFActions(); 288 + IEnumerator l = scanner.actions.GetEnumerator(); 289 + 290 + while (l.MoveNext()) { 291 + Object next = l.Current; 292 + if ( !next.Equals(usedActions[next]) && !eofActions.isEOFAction(next) ) 293 + Out.warning(scanner.file, ErrorMessages.NEVER_MATCH, ((Action) next).priority-1, -1); 294 + } 295 + } 296 + 297 + 298 + /** 299 + * Implementation of Hopcroft's O(n log n) minimization algorithm, follows 300 + * description by D. Gries. 301 + * 302 + * Time: O(n log n) 303 + * Space: O(c n), size < 4*(5*c*n + 13*n + 3*c) byte 304 + */ 305 + public void minimize() { 306 + int i,j; 307 + 308 + Out.print(numStates+" states before minimization, "); 309 + 310 + if (numStates == 0) { 311 + Out.error(ErrorMessages.ZERO_STATES); 312 + throw new GeneratorException(); 313 + } 314 + 315 + if (Options.no_minimize) { 316 + Out.println("minimization skipped."); 317 + return; 318 + } 319 + 320 + // the algorithm needs the DFA to be total, so we add an error state 0, 321 + // and translate the rest of the states by +1 322 + int n = numStates+1; 323 + 324 + // block information: 325 + // [0..n-1] stores which block a state belongs to, 326 + // [n..2*n-1] stores how many elements each block has 327 + int [] block = new int[2*n]; 328 + 329 + // implements a doubly linked list of states (these are the actual blocks) 330 + int [] b_forward = new int[2*n]; 331 + int [] b_backward = new int[2*n]; 332 + 333 + // the last of the blocks currently in use (in [n..2*n-1]) 334 + // (end of list marker, points to the last used block) 335 + int lastBlock = n; // at first we start with one empty block 336 + int b0 = n; // the first block 337 + 338 + // the circular doubly linked list L of pairs (B_i, c) 339 + // (B_i, c) in L iff l_forward[(B_i-n)*numInput+c] > 0 // numeric value of block 0 = n! 340 + int [] l_forward = new int[n*numInput+1]; 341 + int [] l_backward = new int[n*numInput+1]; 342 + int anchorL = n*numInput; // list anchor 343 + 344 + // inverse of the transition table 345 + // if t = inv_delta[s][c] then { inv_delta_set[t], inv_delta_set[t+1], .. inv_delta_set[k] } 346 + // is the set of states, with inv_delta_set[k] = -1 and inv_delta_set[j] >= 0 for t <= j < k 347 + int [] [] inv_delta = new int[n][]; 348 + for (int idx=0; idx < inv_delta.Length; idx++) 349 + inv_delta[idx] = new int[numInput]; 350 + int [] inv_delta_set = new int [2*n*numInput]; 351 + 352 + // twin stores two things: 353 + // twin[0]..twin[numSplit-1] is the list of blocks that have been split 354 + // twin[B_i] is the twin of block B_i 355 + int [] twin = new int[2*n]; 356 + int numSplit; 357 + 358 + // SD[B_i] is the the number of states s in B_i with delta(s,a) in B_j 359 + // if SD[B_i] == block[B_i], there is no need to split 360 + int [] SD = new int[2*n]; // [only SD[n..2*n-1] is used] 361 + 362 + 363 + // for fixed (B_j,a), the D[0]..D[numD-1] are the inv_delta(B_j,a) 364 + int [] D = new int[n]; 365 + int numD; 366 + 367 + 368 + // initialize inverse of transition table 369 + int lastDelta = 0; 370 + int [] inv_lists = new int[n]; // holds a set of lists of states 371 + int [] inv_list_last = new int[n]; // the last element 372 + for (int c = 0; c < numInput; c++) { 373 + // clear "head" and "last element" pointers 374 + for (int s = 0; s < n; s++) { 375 + inv_list_last[s] = -1; 376 + inv_delta[s][c] = -1; 377 + } 378 + 379 + // the error state has a transition for each character into itself 380 + inv_delta[0][c] = 0; 381 + inv_list_last[0] = 0; 382 + 383 + // accumulate states of inverse delta into lists (inv_delta serves as head of list) 384 + for (int s = 1; s < n; s++) { 385 + int t = table[s-1][c]+1; 386 + 387 + if (inv_list_last[t] == -1) { // if there are no elements in the list yet 388 + inv_delta[t][c] = s; // mark t as first and last element 389 + inv_list_last[t] = s; 390 + } 391 + else { 392 + inv_lists[inv_list_last[t]] = s; // link t into chain 393 + inv_list_last[t] = s; // and mark as last element 394 + } 395 + } 396 + 397 + // now move them to inv_delta_set in sequential order, 398 + // and update inv_delta accordingly 399 + for (int s = 0; s < n; s++) { 400 + int i_ = inv_delta[s][c]; inv_delta[s][c] = lastDelta; 401 + int j_ = inv_list_last[s]; 402 + bool go_on = (i_ != -1); 403 + while (go_on) { 404 + go_on = (i_ != j_); 405 + inv_delta_set[lastDelta++] = i_; 406 + i_ = inv_lists[i_]; 407 + } 408 + inv_delta_set[lastDelta++] = -1; 409 + } 410 + } // of initialize inv_delta 411 + 412 + // printInvDelta(inv_delta, inv_delta_set); 413 + 414 + // initialize blocks 415 + 416 + // make b0 = {0} where 0 = the additional error state 417 + b_forward[b0] = 0; 418 + b_backward[b0] = 0; 419 + b_forward[0] = b0; 420 + b_backward[0] = b0; 421 + block[0] = b0; 422 + block[b0] = 1; 423 + 424 + for (int s = 1; s < n; s++) { 425 + // System.out.println("Checking state ["+(s-1)+"]"); 426 + // search the blocks if it fits in somewhere 427 + // (fit in = same pushback behavior, same finalness, same lookahead behavior, same action) 428 + int b = b0+1; // no state can be equivalent to the error state 429 + bool found = false; 430 + while (!found && b <= lastBlock) { 431 + // get some state out of the current block 432 + int t = b_forward[b]; 433 + // System.out.println(" picking state ["+(t-1)+"]"); 434 + 435 + // check, if s could be equivalent with t 436 + found = (isPushback[s-1] == isPushback[t-1]) && (isLookEnd[s-1] == isLookEnd[t-1]); 437 + if (found) { 438 + if (isFinal[s-1]) { 439 + found = isFinal[t-1] && action[s-1].isEquiv(action[t-1]); 440 + } 441 + else { 442 + found = !isFinal[t-1]; 443 + } 444 + 445 + if (found) { // found -> add state s to block b 446 + // System.out.println("Found! Adding to block "+(b-b0)); 447 + // update block information 448 + block[s] = b; 449 + block[b]++; 450 + 451 + // chain in the new element 452 + int last = b_backward[b]; 453 + b_forward[last] = s; 454 + b_forward[s] = b; 455 + b_backward[b] = s; 456 + b_backward[s] = last; 457 + } 458 + } 459 + 460 + b++; 461 + } 462 + 463 + if (!found) { // fits in nowhere -> create new block 464 + // System.out.println("not found, lastBlock = "+lastBlock); 465 + 466 + // update block information 467 + block[s] = b; 468 + block[b]++; 469 + 470 + // chain in the new element 471 + b_forward[b] = s; 472 + b_forward[s] = b; 473 + b_backward[b] = s; 474 + b_backward[s] = b; 475 + 476 + lastBlock++; 477 + } 478 + } // of initialize blocks 479 + 480 + // printBlocks(block,b_forward,b_backward,lastBlock); 481 + 482 + // initialize worklist L 483 + // first, find the largest block B_max, then, all other (B_i,c) go into the list 484 + int B_max = b0; 485 + int B_i; 486 + for (B_i = b0+1; B_i <= lastBlock; B_i++) 487 + if (block[B_max] < block[B_i]) B_max = B_i; 488 + 489 + // L = empty 490 + l_forward[anchorL] = anchorL; 491 + l_backward[anchorL] = anchorL; 492 + 493 + // set up the first list element 494 + if (B_max == b0) B_i = b0+1; else B_i = b0; // there must be at least two blocks 495 + 496 + int index = (B_i-b0)*numInput; // (B_i, 0) 497 + while (index < (B_i+1-b0)*numInput) { 498 + int last = l_backward[anchorL]; 499 + l_forward[last] = index; 500 + l_forward[index] = anchorL; 501 + l_backward[index] = last; 502 + l_backward[anchorL] = index; 503 + index++; 504 + } 505 + 506 + // now do the rest of L 507 + while (B_i <= lastBlock) { 508 + if (B_i != B_max) { 509 + index = (B_i-b0)*numInput; 510 + while (index < (B_i+1-b0)*numInput) { 511 + int last = l_backward[anchorL]; 512 + l_forward[last] = index; 513 + l_forward[index] = anchorL; 514 + l_backward[index] = last; 515 + l_backward[anchorL] = index; 516 + index++; 517 + } 518 + } 519 + B_i++; 520 + } 521 + // end of setup L 522 + 523 + // start of "real" algorithm 524 + // int step = 0; 525 + // System.out.println("max_steps = "+(n*numInput)); 526 + // while L not empty 527 + while (l_forward[anchorL] != anchorL) { 528 + // System.out.println("step : "+(step++)); 529 + // printL(l_forward, l_backward, anchorL); 530 + 531 + // pick and delete (B_j, a) in L: 532 + 533 + // pick 534 + int B_j_a = l_forward[anchorL]; 535 + // delete 536 + l_forward[anchorL] = l_forward[B_j_a]; 537 + l_backward[l_forward[anchorL]] = anchorL; 538 + l_forward[B_j_a] = 0; 539 + // take B_j_a = (B_j-b0)*numInput+c apart into (B_j, a) 540 + int B_j = b0 + B_j_a / numInput; 541 + int a = B_j_a % numInput; 542 + 543 + // printL(l_forward, l_backward, anchorL); 544 + 545 + // System.out.println("picked ("+B_j+","+a+")"); 546 + // printL(l_forward, l_backward, anchorL); 547 + 548 + // determine splittings of all blocks wrt (B_j, a) 549 + // i.e. D = inv_delta(B_j,a) 550 + numD = 0; 551 + int s = b_forward[B_j]; 552 + while (s != B_j) { 553 + // System.out.println("splitting wrt. state "+s); 554 + int t = inv_delta[s][a]; 555 + // System.out.println("inv_delta chunk "+t); 556 + while (inv_delta_set[t] != -1) { 557 + // System.out.println("D+= state "+inv_delta_set[t]); 558 + D[numD++] = inv_delta_set[t++]; 559 + } 560 + s = b_forward[s]; 561 + } 562 + 563 + // clear the twin list 564 + numSplit = 0; 565 + 566 + // System.out.println("splitting blocks according to D"); 567 + 568 + // clear SD and twins (only those B_i that occur in D) 569 + for (int indexD = 0; indexD < numD; indexD++) { // for each s in D 570 + s = D[indexD]; 571 + B_i = block[s]; 572 + SD[B_i] = -1; 573 + twin[B_i] = 0; 574 + } 575 + 576 + // count how many states of each B_i occuring in D go with a into B_j 577 + // Actually we only check, if *all* t in B_i go with a into B_j. 578 + // In this case SD[B_i] == block[B_i] will hold. 579 + for (int indexD = 0; indexD < numD; indexD++) { // for each s in D 580 + s = D[indexD]; 581 + B_i = block[s]; 582 + 583 + // only count, if we haven't checked this block already 584 + if (SD[B_i] < 0) { 585 + SD[B_i] = 0; 586 + int t = b_forward[B_i]; 587 + while (t != B_i && (t != 0 || block[0] == B_j) && 588 + (t == 0 || block[table[t-1][a]+1] == B_j)) { 589 + SD[B_i]++; 590 + t = b_forward[t]; 591 + } 592 + } 593 + } 594 + 595 + // split each block according to D 596 + for (int indexD = 0; indexD < numD; indexD++) { // for each s in D 597 + s = D[indexD]; 598 + B_i = block[s]; 599 + 600 + // System.out.println("checking if block "+(B_i-b0)+" must be split because of state "+s); 601 + 602 + if (SD[B_i] != block[B_i]) { 603 + // System.out.println("state "+(s-1)+" must be moved"); 604 + int B_k = twin[B_i]; 605 + if (B_k == 0) { 606 + // no twin for B_i yet -> generate new block B_k, make it B_i's twin 607 + B_k = ++lastBlock; 608 + // System.out.println("creating block "+(B_k-n)); 609 + // printBlocks(block,b_forward,b_backward,lastBlock-1); 610 + b_forward[B_k] = B_k; 611 + b_backward[B_k] = B_k; 612 + 613 + twin[B_i] = B_k; 614 + 615 + // mark B_i as split 616 + twin[numSplit++] = B_i; 617 + } 618 + // move s from B_i to B_k 619 + 620 + // remove s from B_i 621 + b_forward[b_backward[s]] = b_forward[s]; 622 + b_backward[b_forward[s]] = b_backward[s]; 623 + 624 + // add s to B_k 625 + int last = b_backward[B_k]; 626 + b_forward[last] = s; 627 + b_forward[s] = B_k; 628 + b_backward[s] = last; 629 + b_backward[B_k] = s; 630 + 631 + block[s] = B_k; 632 + block[B_k]++; 633 + block[B_i]--; 634 + 635 + SD[B_i]--; // there is now one state less in B_i that goes with a into B_j 636 + // printBlocks(block, b_forward, b_backward, lastBlock); 637 + // System.out.println("finished move"); 638 + } 639 + } // of block splitting 640 + 641 + // printBlocks(block, b_forward, b_backward, lastBlock); 642 + 643 + // System.out.println("updating L"); 644 + 645 + // update L 646 + for (int indexTwin = 0; indexTwin < numSplit; indexTwin++) { 647 + B_i = twin[indexTwin]; 648 + int B_k = twin[B_i]; 649 + for (int c = 0; c < numInput; c++) { 650 + int B_i_c = (B_i-b0)*numInput+c; 651 + int B_k_c = (B_k-b0)*numInput+c; 652 + if (l_forward[B_i_c] > 0) { 653 + // (B_i,c) already in L --> put (B_k,c) in L 654 + int last = l_backward[anchorL]; 655 + l_backward[anchorL] = B_k_c; 656 + l_forward[last] = B_k_c; 657 + l_backward[B_k_c] = last; 658 + l_forward[B_k_c] = anchorL; 659 + } 660 + else { 661 + // put the smaller block in L 662 + if (block[B_i] <= block[B_k]) { 663 + int last = l_backward[anchorL]; 664 + l_backward[anchorL] = B_i_c; 665 + l_forward[last] = B_i_c; 666 + l_backward[B_i_c] = last; 667 + l_forward[B_i_c] = anchorL; 668 + } 669 + else { 670 + int last = l_backward[anchorL]; 671 + l_backward[anchorL] = B_k_c; 672 + l_forward[last] = B_k_c; 673 + l_backward[B_k_c] = last; 674 + l_forward[B_k_c] = anchorL; 675 + } 676 + } 677 + } 678 + } 679 + } 680 + 681 + // System.out.println("Result"); 682 + // printBlocks(block,b_forward,b_backward,lastBlock); 683 + 684 + /* 685 + System.out.println("Old minimization:"); 686 + boolean [] [] equiv = old_minimize(); 687 + 688 + boolean error = false; 689 + for (int i = 1; i < equiv.length; i++) { 690 + for (int j = 0; j < equiv[i].length; j++) { 691 + if (equiv[i][j] != (block[i+1] == block[j+1])) { 692 + System.out.println("error: equiv["+i+"]["+j+"] = "+equiv[i][j]+ 693 + ", block["+i+"] = "+block[i+1]+", block["+j+"] = "+block[j]); 694 + error = true; 695 + } 696 + } 697 + } 698 + 699 + if (error) System.exit(1); 700 + System.out.println("check"); 701 + */ 702 + 703 + // transform the transition table 704 + 705 + // trans[i] is the state j that will replace state i, i.e. 706 + // states i and j are equivalent 707 + int[] trans = new int [numStates]; 708 + 709 + // kill[i] is true iff state i is redundant and can be removed 710 + bool[] kill = new bool [numStates]; 711 + 712 + // move[i] is the amount line i has to be moved in the transition table 713 + // (because states j < i have been removed) 714 + int[] move = new int [numStates]; 715 + 716 + // fill arrays trans[] and kill[] (in O(n)) 717 + for (int b = b0+1; b <= lastBlock; b++) { // b0 contains the error state 718 + // get the state with smallest value in current block 719 + int s = b_forward[b]; 720 + int min_s = s; // there are no empty blocks! 721 + for (; s != b; s = b_forward[s]) 722 + if (min_s > s) min_s = s; 723 + // now fill trans[] and kill[] for this block 724 + // (and translate states back to partial DFA) 725 + min_s--; 726 + for (s = b_forward[b]-1; s != b-1; s = b_forward[s+1]-1) { 727 + trans[s] = min_s; 728 + kill[s] = s != min_s; 729 + } 730 + } 731 + 732 + // fill array move[] (in O(n)) 733 + int amount = 0; 734 + for (int idx = 0; idx < numStates; idx++) { 735 + if ( kill[idx] ) 736 + amount++; 737 + else 738 + move[idx] = amount; 739 + } 740 + 741 + // j is the index in the new transition table 742 + // the transition table is transformed in place (in O(c n)) 743 + for (i = 0, j = 0; i < numStates; i++) { 744 + 745 + // we only copy lines that have not been removed 746 + if ( !kill[i] ) { 747 + 748 + // translate the target states 749 + for (int c = 0; c < numInput; c++) { 750 + if ( table[i][c] >= 0 ) { 751 + table[j][c] = trans[ table[i][c] ]; 752 + table[j][c]-= move[ table[j][c] ]; 753 + } 754 + else { 755 + table[j][c] = table[i][c]; 756 + } 757 + } 758 + 759 + isFinal[j] = isFinal[i]; 760 + isPushback[j] = isPushback[i]; 761 + isLookEnd[j] = isLookEnd[i]; 762 + action[j] = action[i]; 763 + 764 + j++; 765 + } 766 + } 767 + 768 + numStates = j; 769 + 770 + // translate lexical states 771 + for (i = 0; i < lexState.Length; i++) { 772 + lexState[i] = trans[ lexState[i] ]; 773 + lexState[i]-= move[ lexState[i] ]; 774 + } 775 + 776 + Out.println(numStates+" states in minimized DFA"); 777 + } 778 + 779 + public String ToString(int [] a) { 780 + String r = "{"; 781 + int i; 782 + for (i = 0; i < a.Length-1; i++) r += a[i]+","; 783 + return r+a[i]+"}"; 784 + } 785 + 786 + public void printBlocks(int [] b, int [] b_f, int [] b_b, int last) { 787 + Out.dump("block : "+ToString(b)); 788 + Out.dump("b_forward : "+ToString(b_f)); 789 + Out.dump("b_backward: "+ToString(b_b)); 790 + Out.dump("lastBlock : "+last); 791 + int n = numStates+1; 792 + for (int i = n; i <= last; i ++) { 793 + Out.dump("Block "+(i-n)+" (size "+b[i]+"):"); 794 + String line = "{"; 795 + int s = b_f[i]; 796 + while (s != i) { 797 + line = line+(s-1); 798 + int t = s; 799 + s = b_f[s]; 800 + if (s != i) { 801 + line = line+","; 802 + if (b[s] != i) Out.dump("consistency error for state "+(s-1)+" (block "+b[s]+")"); 803 + } 804 + if (b_b[s] != t) Out.dump("consistency error for b_back in state "+(s-1)+" (back = "+b_b[s]+", should be = "+t+")"); 805 + } 806 + Out.dump(line+"}"); 807 + } 808 + } 809 + 810 + public void printL(int [] l_f, int [] l_b, int anchor) { 811 + String l = "L = {"; 812 + int bc = l_f[anchor]; 813 + while (bc != anchor) { 814 + int b = bc / numInput; 815 + int c = bc % numInput; 816 + l+= "("+b+","+c+")"; 817 + int old_bc = bc; 818 + bc = l_f[bc]; 819 + if (bc != anchor) l+= ","; 820 + if (l_b[bc] != old_bc) Out.dump("consistency error for ("+b+","+c+")"); 821 + } 822 + Out.dump(l+"}"); 823 + } 824 + 825 + 826 + public bool [] [] old_minimize() { 827 + 828 + int i,j; 829 + char c; 830 + 831 + Out.print(numStates+" states before minimization, "); 832 + 833 + if (numStates == 0) { 834 + Out.error(ErrorMessages.ZERO_STATES); 835 + throw new GeneratorException(); 836 + } 837 + 838 + if (Options.no_minimize) { 839 + Out.println("minimization skipped."); 840 + return null; 841 + } 842 + 843 + // notequiv[i][j] == true <=> state i and state j are equivalent 844 + bool [] [] equiv = new bool [numStates] []; 845 + 846 + // list[i][j] contains all pairs of states that have to be marked "not equivalent" 847 + // if states i and j are recognized to be not equivalent 848 + StatePairList [] [] list = new StatePairList [numStates] []; 849 + 850 + // construct a triangular matrix equiv[i][j] with j < i 851 + // and mark pairs (final state, not final state) as not equivalent 852 + for (i = 1; i < numStates; i++) { 853 + list[i] = new StatePairList[i]; 854 + equiv[i] = new bool [i]; 855 + for (j = 0; j < i; j++) { 856 + // i and j are equivalent, iff : 857 + // i and j are both final and their actions are equivalent and have same pushback behaviour or 858 + // i and j are both not final 859 + 860 + if ( isFinal[i] && isFinal[j] && (isPushback[i] == isPushback[j]) && (isLookEnd[i] == isLookEnd[j]) ) 861 + equiv[i][j] = action[i].isEquiv(action[j]) && !Options.emit_csharp; // C# #line directives get messed up by merged states 862 + else 863 + equiv[i][j] = !isFinal[j] && !isFinal[i] && (isPushback[i] == isPushback[j]) && (isLookEnd[i] == isLookEnd[j]); 864 + } 865 + } 866 + 867 + 868 + for (i = 1; i < numStates; i++) { 869 + 870 + Out.debug("Testing state "+i); 871 + 872 + for (j = 0; j < i; j++) { 873 + 874 + if ( equiv[i][j] ) { 875 + 876 + for (c = (char)0; c < numInput; c++) { 877 + 878 + if (equiv[i][j]) { 879 + 880 + int p = table[i][c]; 881 + int q = table[j][c]; 882 + if (p < q) { 883 + int t = p; 884 + p = q; 885 + q = t; 886 + } 887 + if ( p >= 0 || q >= 0 ) { 888 + // Out.debug("Testing input '"+c+"' for ("+i+","+j+")"); 889 + // Out.debug("Target states are ("+p+","+q+")"); 890 + if ( p!=q && (p == -1 || q == -1 || !equiv[p][q]) ) { 891 + equiv[i][j] = false; 892 + if (list[i][j] != null) list[i][j].markAll(list,equiv); 893 + } 894 + // printTable(equiv); 895 + } // if (p >= 0) .. 896 + } // if (equiv[i][j] 897 + } // for (char c = 0; c < numInput .. 898 + 899 + // if i and j are still marked equivalent.. 900 + 901 + if ( equiv[i][j] ) { 902 + 903 + // Out.debug("("+i+","+j+") are still marked equivalent"); 904 + 905 + for (c = (char)0; c < numInput; c++) { 906 + 907 + int p = table[i][c]; 908 + int q = table[j][c]; 909 + if (p < q) { 910 + int t = p; 911 + p = q; 912 + q = t; 913 + } 914 + 915 + if (p != q && p >= 0 && q >= 0) { 916 + if ( list[p][q] == null ) { 917 + list[p][q] = new StatePairList(); 918 + } 919 + list[p][q].addPair(i,j); 920 + } 921 + } 922 + } 923 + else { 924 + // Out.debug("("+i+","+j+") are not equivalent"); 925 + } 926 + 927 + } // of first if (equiv[i][j]) 928 + } // of for j 929 + } // of for i 930 + // } 931 + 932 + // printTable(equiv); 933 + 934 + return equiv; 935 + } 936 + 937 + 938 + public void printInvDelta(int [] [] inv_delta, int [] inv_delta_set) { 939 + Out.dump("Inverse of transition table: "); 940 + for (int s = 0; s < numStates+1; s++) { 941 + Out.dump("State ["+(s-1)+"]"); 942 + for (int c = 0; c < numInput; c++) { 943 + String line = "With <"+c+"> in {"; 944 + int t = inv_delta[s][c]; 945 + while (inv_delta_set[t] != -1) { 946 + line += inv_delta_set[t++]-1; 947 + if (inv_delta_set[t] != -1) line += ","; 948 + } 949 + if (inv_delta_set[inv_delta[s][c]] != -1) 950 + Out.dump(line+"}"); 951 + } 952 + } 953 + } 954 + 955 + public void printTable(bool [] [] equiv) { 956 + 957 + Out.dump("Equivalence table is : "); 958 + for (int i = 1; i < numStates; i++) { 959 + String line = i+" :"; 960 + for (int j = 0; j < i; j++) { 961 + if (equiv[i][j]) 962 + line+= " E"; 963 + else 964 + line+= " x"; 965 + } 966 + Out.dump(line); 967 + } 968 + } 969 + 970 + } 971 + }
+104
CSFlex/Core/EOFActions.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + using System.Collections; 27 + 28 + namespace CSFlex 29 + { 30 + 31 + /** 32 + * A simple table to store EOF actions for each lexical state. 33 + * 34 + * @author Gerwin Klein 35 + * @version JFlex 1.4, $Revision: 2.1 $, $Date: 2004/04/12 10:07:47 $ 36 + * @author Jonathan Gilbert 37 + * @version CSFlex 1.4 38 + */ 39 + public class EOFActions { 40 + 41 + /** maps lexical states to actions */ 42 + private Hashtable /* Integer -> Action */ actions = new PrettyHashtable(); 43 + private Action defaultAction; 44 + private int numLexStates; 45 + 46 + public void setNumLexStates(int num) { 47 + numLexStates = num; 48 + } 49 + 50 + public void add(ArrayList stateList, Action action) { 51 + 52 + if (stateList != null && stateList.Count > 0) { 53 + IEnumerator states = stateList.GetEnumerator(); 54 + 55 + while (states.MoveNext()) 56 + add( (int)states.Current, action ); 57 + } 58 + else { 59 + defaultAction = action.getHigherPriority(defaultAction); 60 + 61 + for (int i = 0; i < numLexStates; i++) { 62 + int state = i; 63 + if ( actions[state] != null ) { 64 + Action oldAction = (Action) actions[state]; 65 + actions[state] = oldAction.getHigherPriority(action); 66 + } 67 + } 68 + } 69 + } 70 + 71 + public void add(int state, Action action) { 72 + if ( actions[state] == null ) 73 + actions[state] = action; 74 + else { 75 + Action oldAction = (Action) actions[state]; 76 + actions[state] = oldAction.getHigherPriority(action); 77 + } 78 + } 79 + 80 + public bool isEOFAction(Object a) { 81 + if (a == defaultAction) return true; 82 + 83 + return actions.ContainsValue(a); 84 + /* 85 + IEnumerator e = actions.GetEnumerator(); 86 + while ( e.MoveNext() ) 87 + if (a == e.Current) return true; 88 + 89 + return false; /* */ 90 + } 91 + 92 + public Action getAction(int state) { 93 + return (Action) actions[state]; 94 + } 95 + 96 + public Action getDefault() { 97 + return defaultAction; 98 + } 99 + 100 + public int numActions() { 101 + return actions.Count; 102 + } 103 + } 104 + }
+2014
CSFlex/Core/Emitter.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + using System.Collections; 27 + using System.IO; 28 + using System.Linq; 29 + using System.Text; 30 + 31 + // Modified in July 2026 by the Prexonite contributors for deterministic, 32 + // in-memory source generation. See COPYRIGHT for GNU GPL version 2 terms. 33 + 34 + namespace CSFlex 35 + { 36 + 37 + /** 38 + * This class manages the actual code generation, putting 39 + * the scanner together, filling in skeleton sections etc. 40 + * 41 + * Table compression, String packing etc. is also done here. 42 + * 43 + * @author Gerwin Klein 44 + * @version JFlex 1.4, $Revision: 2.22 $, $Date: 2004/04/12 10:07:48 $ 45 + * @author Jonathan Gilbert 46 + * @version CSFlex 1.4 47 + */ 48 + sealed public class Emitter { 49 + 50 + // bit masks for state attributes 51 + private const int FINAL = 1; 52 + private const int PUSHBACK = 2; 53 + private const int LOOKEND = 4; 54 + private const int NOLOOK = 8; 55 + 56 + private File inputFile; 57 + 58 + private TextWriter @out; 59 + private Skeleton skel; 60 + private LexScan scanner; 61 + private LexParse parser; 62 + private DFA dfa; 63 + 64 + // for switch statement: 65 + // table[i][j] is the set of input characters that leads from state i to state j 66 + private CharSet[][] table; 67 + 68 + private bool[] isTransition; 69 + 70 + // noTarget[i] is the set of input characters that have no target state in state i 71 + private CharSet[] noTarget; 72 + 73 + // for row killing: 74 + private int numRows; 75 + private int [] rowMap; 76 + private bool [] rowKilled; 77 + 78 + // for col killing: 79 + private int numCols; 80 + private int [] colMap; 81 + private bool [] colKilled; 82 + 83 + 84 + /** maps actions to their switch label */ 85 + private Hashtable actionTable = new PrettyHashtable(); 86 + 87 + private CharClassInterval [] intervalls; 88 + 89 + private String visibility = "public"; 90 + 91 + public Emitter(File inputFile, LexParse parser, DFA dfa, TextWriter output) { 92 + this.@out = output; 93 + this.parser = parser; 94 + this.scanner = parser.scanner; 95 + this.visibility = scanner.visibility; 96 + this.inputFile = inputFile; 97 + this.dfa = dfa; 98 + this.skel = new Skeleton(@out); 99 + } 100 + 101 + 102 + private void println() { 103 + @out.WriteLine(); 104 + } 105 + 106 + private void println(String line) { 107 + @out.WriteLine(line); 108 + } 109 + 110 + private void println(int i) { 111 + @out.WriteLine(i); 112 + } 113 + 114 + private void print(String line) { 115 + @out.Write(line); 116 + } 117 + 118 + private void print(int i) { 119 + @out.Write(i); 120 + } 121 + 122 + private void print(int i, int tab) { 123 + int exp; 124 + 125 + if (i < 0) 126 + exp = 1; 127 + else 128 + exp = 10; 129 + 130 + while (tab-- > 1) { 131 + if (Math.Abs(i) < exp) print(" "); 132 + exp*= 10; 133 + } 134 + 135 + print(i); 136 + } 137 + 138 + private void emitScanError() { 139 + print(" private void zzScanError(int errorCode)"); 140 + 141 + if (!Options.emit_csharp) 142 + { 143 + if (scanner.scanErrorException != null) 144 + print(" throws "+scanner.scanErrorException); 145 + } 146 + 147 + println(" {"); 148 + 149 + skel.emitNext(); 150 + 151 + if (scanner.scanErrorException == null) 152 + { 153 + if (Options.emit_csharp) 154 + println(" throw new Exception(message);"); 155 + else 156 + println(" throw new Error(message);"); 157 + } 158 + else 159 + println(" throw new "+scanner.scanErrorException+"(message);"); 160 + 161 + skel.emitNext(); 162 + 163 + print(" "+visibility+" void yypushback(int number) "); 164 + 165 + if (scanner.scanErrorException == null) 166 + println(" {"); 167 + else 168 + { 169 + if (Options.emit_csharp) 170 + println(" {"); 171 + else 172 + println(" throws "+scanner.scanErrorException+" {"); 173 + } 174 + } 175 + 176 + private void emitMain() { 177 + if ( !(scanner.standalone || scanner.debugOption || scanner.cupDebug) ) return; 178 + 179 + if ( scanner.cupDebug ) { 180 + println(" /**"); 181 + println(" * Converts an int token code into the name of the"); 182 + println(" * token by reflection on the cup symbol class/interface "+scanner.cupSymbol); 183 + println(" *"); 184 + println(" * This code was contributed by Karl Meissner <meissnersd@yahoo.com>"); 185 + println(" */"); 186 + if (Options.emit_csharp) 187 + { 188 + println(" private String getTokenName(int token) {"); 189 + println(" try {"); 190 + println(" System.Reflection.FieldInfo[] classFields = typeof(" + scanner.cupSymbol + ").GetFields();"); 191 + println(" for (int i = 0; i < classFields.Length; i++) {"); 192 + println(" if (((int)classFields[i].GetValue(null)) == token) {"); 193 + println(" return classFields[i].Name;"); 194 + println(" }"); 195 + println(" }"); 196 + println(" } catch (Exception e) {"); 197 + println(" Out.error(e.ToString());"); 198 + println(" }"); 199 + println(""); 200 + println(" return \"UNKNOWN TOKEN\";"); 201 + println(" }"); 202 + } 203 + else 204 + { 205 + println(" private String getTokenName(int token) {"); 206 + println(" try {"); 207 + println(" java.lang.reflect.Field [] classFields = " + scanner.cupSymbol + ".class.getFields();"); 208 + println(" for (int i = 0; i < classFields.length; i++) {"); 209 + println(" if (classFields[i].getInt(null) == token) {"); 210 + println(" return classFields[i].getName();"); 211 + println(" }"); 212 + println(" }"); 213 + println(" } catch (Exception e) {"); 214 + println(" e.printStackTrace(System.err);"); 215 + println(" }"); 216 + println(""); 217 + println(" return \"UNKNOWN TOKEN\";"); 218 + println(" }"); 219 + } 220 + println(""); 221 + println(" /**"); 222 + println(" * Same as "+scanner.functionName+" but also prints the token to standard out"); 223 + println(" * for debugging."); 224 + println(" *"); 225 + println(" * This code was contributed by Karl Meissner <meissnersd@yahoo.com>"); 226 + println(" */"); 227 + 228 + print(" "+visibility+" "); 229 + if ( scanner.tokenType == null ) { 230 + if ( scanner.isInteger ) 231 + print( "int" ); 232 + else 233 + if ( scanner.isIntWrap ) 234 + print( "Integer" ); 235 + else 236 + print( "Yytoken" ); 237 + } 238 + else 239 + print( scanner.tokenType ); 240 + 241 + print(" debug_"); 242 + 243 + print(scanner.functionName); 244 + 245 + if (Options.emit_csharp) 246 + print("()"); 247 + else 248 + { 249 + print("() throws java.io.IOException"); 250 + 251 + if ( scanner.lexThrow != null ) 252 + { 253 + print(", "); 254 + print(scanner.lexThrow); 255 + } 256 + 257 + if ( scanner.scanErrorException != null ) 258 + { 259 + print(", "); 260 + print(scanner.scanErrorException); 261 + } 262 + } 263 + 264 + println(" {"); 265 + 266 + println(" java_cup.runtime.Symbol s = "+scanner.functionName+"();"); 267 + if (Options.emit_csharp) 268 + { 269 + print(" Console.WriteLine( \""); 270 + 271 + int @base = 0; 272 + 273 + if (scanner.lineCount) { print("line:{"+@base+"}"); @base++; } 274 + if (scanner.columnCount) { print(" col:{"+@base+"}"); @base++; } 275 + println(" --{" + (@base) + "}--{" + (@base + 1) + "}--\","); 276 + println(" "); 277 + if (scanner.lineCount) print("yyline+1, "); 278 + if (scanner.columnCount) print("yycolumn+1, "); 279 + println("yytext(), getTokenName(s.sym));"); 280 + } 281 + else 282 + { 283 + print(" System.out.println( "); 284 + if (scanner.lineCount) print("\"line:\" + (yyline+1) + "); 285 + if (scanner.columnCount) print("\" col:\" + (yycolumn+1) + "); 286 + println("\" --\"+ yytext() + \"--\" + getTokenName(s.sym) + \"--\");"); 287 + } 288 + println(" return s;"); 289 + println(" }"); 290 + println(""); 291 + } 292 + 293 + if ( scanner.standalone ) { 294 + println(" /**"); 295 + println(" * Runs the scanner on input files."); 296 + println(" *"); 297 + println(" * This is a standalone scanner, it will print any unmatched"); 298 + println(" * text to System.out unchanged."); 299 + println(" *"); 300 + println(" * @param argv the command line, contains the filenames to run"); 301 + println(" * the scanner on."); 302 + println(" */"); 303 + } 304 + else { 305 + println(" /**"); 306 + println(" * Runs the scanner on input files."); 307 + println(" *"); 308 + println(" * This main method is the debugging routine for the scanner."); 309 + println(" * It prints debugging information about each returned token to"); 310 + println(" * System.out until the end of file is reached, or an error occured."); 311 + println(" *"); 312 + println(" * @param argv the command line, contains the filenames to run"); 313 + println(" * the scanner on."); 314 + println(" */"); 315 + } 316 + 317 + if (Options.emit_csharp) 318 + { 319 + println(" public static void Main(String[] argv) {"); 320 + println(" if (argv.Length == 0) {"); 321 + println(" Console.WriteLine(\"Usage : "+scanner.className+" <inputfile>\");"); 322 + println(" }"); 323 + println(" else {"); 324 + println(" for (int i = 0; i < argv.Length; i++) {"); 325 + println(" "+scanner.className+" scanner = null;"); 326 + println(" try {"); 327 + println(" scanner = new "+scanner.className+"( new StreamReader(argv[i]) );"); 328 + 329 + if ( scanner.standalone ) 330 + { 331 + println(" while ( !scanner.zzAtEOF ) scanner."+scanner.functionName+"();"); 332 + } 333 + else if (scanner.cupDebug ) 334 + { 335 + println(" while ( !scanner.zzAtEOF ) scanner.debug_"+scanner.functionName+"();"); 336 + } 337 + else 338 + { 339 + println(" do {"); 340 + println(" System.out.println(scanner."+scanner.functionName+"());"); 341 + println(" } while (!scanner.zzAtEOF);"); 342 + println(""); 343 + } 344 + 345 + println(" }"); 346 + println(" catch (FileNotFoundException) {"); 347 + println(" Console.WriteLine(\"File not found : \\\"{0}\\\"\", argv[i]);"); 348 + println(" }"); 349 + println(" catch (IOException e) {"); 350 + println(" Console.WriteLine(\"IO error scanning file \\\"{0}\\\"\", argv[i]);"); 351 + println(" Console.WriteLine(e);"); 352 + println(" }"); 353 + println(" catch (Exception e) {"); 354 + println(" Console.WriteLine(\"Unexpected exception:\");"); 355 + println(" Console.WriteLine(e.ToString());"); 356 + println(" }"); 357 + println(" }"); 358 + println(" }"); 359 + println(" }"); 360 + } 361 + else 362 + { 363 + println(" public static void main(String argv[]) {"); 364 + println(" if (argv.length == 0) {"); 365 + println(" System.out.println(\"Usage : java "+scanner.className+" <inputfile>\");"); 366 + println(" }"); 367 + println(" else {"); 368 + println(" for (int i = 0; i < argv.length; i++) {"); 369 + println(" "+scanner.className+" scanner = null;"); 370 + println(" try {"); 371 + println(" scanner = new "+scanner.className+"( new java.io.FileReader(argv[i]) );"); 372 + 373 + if ( scanner.standalone ) 374 + { 375 + println(" while ( !scanner.zzAtEOF ) scanner."+scanner.functionName+"();"); 376 + } 377 + else if (scanner.cupDebug ) 378 + { 379 + println(" while ( !scanner.zzAtEOF ) scanner.debug_"+scanner.functionName+"();"); 380 + } 381 + else 382 + { 383 + println(" do {"); 384 + println(" System.out.println(scanner."+scanner.functionName+"());"); 385 + println(" } while (!scanner.zzAtEOF);"); 386 + println(""); 387 + } 388 + 389 + println(" }"); 390 + println(" catch (java.io.FileNotFoundException e) {"); 391 + println(" System.out.println(\"File not found : \\\"\"+argv[i]+\"\\\"\");"); 392 + println(" }"); 393 + println(" catch (java.io.IOException e) {"); 394 + println(" System.out.println(\"IO error scanning file \\\"\"+argv[i]+\"\\\"\");"); 395 + println(" System.out.println(e);"); 396 + println(" }"); 397 + println(" catch (Exception e) {"); 398 + println(" System.out.println(\"Unexpected exception:\");"); 399 + println(" e.printStackTrace();"); 400 + println(" }"); 401 + println(" }"); 402 + println(" }"); 403 + println(" }"); 404 + } 405 + println(""); 406 + } 407 + 408 + private void emitNoMatch() { 409 + println(" zzScanError(ZZ_NO_MATCH);"); 410 + } 411 + 412 + private void emitNextInput() { 413 + println(" if (zzCurrentPosL < zzEndReadL)"); 414 + println(" zzInput = zzBufferL[zzCurrentPosL++];"); 415 + println(" else if (zzAtEOF) {"); 416 + println(" zzInput = YYEOF;"); 417 + if (Options.emit_csharp) 418 + println(" goto zzForAction;"); 419 + else 420 + println(" break zzForAction;"); 421 + println(" }"); 422 + println(" else {"); 423 + println(" // store back cached positions"); 424 + println(" zzCurrentPos = zzCurrentPosL;"); 425 + println(" zzMarkedPos = zzMarkedPosL;"); 426 + if ( scanner.lookAheadUsed ) 427 + println(" zzPushbackPos = zzPushbackPosL;"); 428 + if (Options.emit_csharp) 429 + println(" bool eof = zzRefill();"); 430 + else 431 + println(" boolean eof = zzRefill();"); 432 + println(" // get translated positions and possibly new buffer"); 433 + println(" zzCurrentPosL = zzCurrentPos;"); 434 + println(" zzMarkedPosL = zzMarkedPos;"); 435 + println(" zzBufferL = zzBuffer;"); 436 + println(" zzEndReadL = zzEndRead;"); 437 + if ( scanner.lookAheadUsed ) 438 + println(" zzPushbackPosL = zzPushbackPos;"); 439 + println(" if (eof) {"); 440 + println(" zzInput = YYEOF;"); 441 + if (Options.emit_csharp) 442 + println(" goto zzForAction;"); 443 + else 444 + println(" break zzForAction;"); 445 + println(" }"); 446 + println(" else {"); 447 + println(" zzInput = zzBufferL[zzCurrentPosL++];"); 448 + println(" }"); 449 + println(" }"); 450 + } 451 + 452 + private void emitHeader() { 453 + println("/* The following code was generated by CSFlex "+GeneratorCore.Version+" */"); 454 + println(""); 455 + } 456 + 457 + private void emitUserCode() { 458 + if ( scanner.userCode.Length > 0 ) 459 + { 460 + if (Options.emit_csharp) 461 + { 462 + println("#line 1 \"" + scanner.file + "\""); 463 + println(scanner.userCode.ToString()); 464 + println("#line default"); 465 + } 466 + else 467 + println(scanner.userCode.ToString()); 468 + } 469 + } 470 + 471 + private void emitEpilogue() 472 + { 473 + if (scanner.epilogue.Length > 0) 474 + { 475 + if (Options.emit_csharp) 476 + { 477 + println("#line " + scanner.epilogue_line + " \"" + scanner.file + "\""); 478 + println(scanner.epilogue.ToString()); 479 + println("#line default"); 480 + } 481 + else 482 + println(scanner.epilogue.ToString()); 483 + } 484 + } 485 + 486 + private void emitClassName() { 487 + if (!endsWithJavadoc(scanner.userCode)) { 488 + String path = inputFile.ToString(); 489 + // slashify path (avoid backslash u sequence = unicode escape) 490 + if (File.separatorChar != '/') { 491 + path = path.Replace(File.separatorChar, '/'); 492 + } 493 + 494 + println("/**"); 495 + println(" * This class is a scanner generated by <a href=\"http://www.sourceforge.net/projects/csflex/\">C# Flex</a>, based on"); 496 + println(" * <a href=\"http://www.jflex.de/\">JFlex</a>, version "+GeneratorCore.Version); 497 + println(" * from the specification file"); 498 + println(" * <tt>"+path+"</tt>"); 499 + println(" */"); 500 + } 501 + 502 + if ( scanner.isPublic ) print("public "); 503 + 504 + if ( scanner.isAbstract) print("abstract "); 505 + 506 + if ( scanner.isFinal ) 507 + { 508 + if (Options.emit_csharp) 509 + print("sealed "); 510 + else 511 + print("final "); 512 + } 513 + 514 + print("class "); 515 + print(scanner.className); 516 + 517 + if ( scanner.isExtending != null ) { 518 + if (Options.emit_csharp) 519 + print(": "); 520 + else 521 + print(" extends "); 522 + print(scanner.isExtending); 523 + } 524 + 525 + if ( scanner.isImplementing != null ) { 526 + if (Options.emit_csharp) 527 + { 528 + if (scanner.isExtending != null) // then we already output the ':' 529 + print(", "); 530 + else 531 + print(": "); 532 + } 533 + else 534 + print(" implements "); 535 + print(scanner.isImplementing); 536 + } 537 + 538 + println(" {"); 539 + } 540 + 541 + /** 542 + * Try to find out if user code ends with a javadoc comment 543 + * 544 + * @param buffer the user code 545 + * @return true if it ends with a javadoc comment 546 + */ 547 + public static bool endsWithJavadoc(StringBuilder usercode) { 548 + String s = usercode.ToString().Trim(); 549 + 550 + if (!s.EndsWith("*/")) return false; 551 + 552 + // find beginning of javadoc comment 553 + int i = s.LastIndexOf("/**"); 554 + if (i < 0) return false; 555 + 556 + // javadoc comment shouldn't contain a comment end 557 + return s.Substring(i,s.Length-2-i).IndexOf("*/") < 0; 558 + } 559 + 560 + 561 + private void emitLexicalStates() { 562 + IEnumerator stateNames = scanner.states.names(); 563 + 564 + string @const = (Options.emit_csharp ? "const" : "static final"); 565 + 566 + while ( stateNames.MoveNext() ) { 567 + String name = (String) stateNames.Current; 568 + 569 + int num = scanner.states.getNumber(name).intValue(); 570 + 571 + if (scanner.bolUsed) 572 + println(" "+visibility+" "+@const+" int "+name+" = "+2*num+";"); 573 + else 574 + println(" "+visibility+" "+@const+" int "+name+" = "+dfa.lexState[2*num]+";"); 575 + } 576 + 577 + if (scanner.bolUsed) { 578 + println(""); 579 + println(" /**"); 580 + println(" * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l"); 581 + println(" * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l"); 582 + println(" * at the beginning of a line"); 583 + println(" * l is of the form l = 2*k, k a non negative integer"); 584 + println(" */"); 585 + if (Options.emit_csharp) 586 + println(" private static readonly int[] ZZ_LEXSTATE = new int[]{ "); 587 + else 588 + println(" private static final int ZZ_LEXSTATE[] = { "); 589 + 590 + int i, j = 0; 591 + print(" "); 592 + 593 + for (i = 0; i < dfa.lexState.Length-1; i++) { 594 + print( dfa.lexState[i], 2 ); 595 + 596 + print(", "); 597 + 598 + if (++j >= 16) { 599 + println(); 600 + print(" "); 601 + j = 0; 602 + } 603 + } 604 + 605 + println( dfa.lexState[i] ); 606 + println(" };"); 607 + 608 + } 609 + } 610 + 611 + private void emitDynamicInit() { 612 + int count = 0; 613 + int value = dfa.table[0][0]; 614 + 615 + println(" /** "); 616 + println(" * The transition table of the DFA"); 617 + println(" */"); 618 + 619 + CountEmitter e = new CountEmitter("Trans"); 620 + e.setValTranslation(+1); // allow vals in [-1, 0xFFFE] 621 + e.emitInit(); 622 + 623 + for (int i = 0; i < dfa.numStates; i++) { 624 + if ( !rowKilled[i] ) { 625 + for (int c = 0; c < dfa.numInput; c++) { 626 + if ( !colKilled[c] ) { 627 + if (dfa.table[i][c] == value) { 628 + count++; 629 + } 630 + else { 631 + e.emit(count, value); 632 + 633 + count = 1; 634 + value = dfa.table[i][c]; 635 + } 636 + } 637 + } 638 + } 639 + } 640 + 641 + e.emit(count, value); 642 + e.emitUnpack(); 643 + 644 + println(e.ToString()); 645 + } 646 + 647 + 648 + private void emitCharMapInitFunction() { 649 + 650 + CharClasses cl = parser.getCharClasses(); 651 + 652 + if ( cl.getMaxCharCode() < 256 ) return; 653 + 654 + println(""); 655 + println(" /** "); 656 + println(" * Unpacks the compressed character translation table."); 657 + println(" *"); 658 + println(" * @param packed the packed character translation table"); 659 + println(" * @return the unpacked character translation table"); 660 + println(" */"); 661 + if (Options.emit_csharp) 662 + { 663 + println(" private static char [] zzUnpackCMap(ushort[] packed) {"); 664 + println(" char [] map = new char[0x10000];"); 665 + println(" int i = 0; /* index in packed string */"); 666 + println(" int j = 0; /* index in unpacked array */"); 667 + println(" while (i < "+2*intervalls.Length+") {"); 668 + println(" int count = packed[i++];"); 669 + println(" char value = (char)packed[i++];"); 670 + println(" do map[j++] = value; while (--count > 0);"); 671 + println(" }"); 672 + println(" return map;"); 673 + println(" }"); 674 + } 675 + else 676 + { 677 + println(" private static char [] zzUnpackCMap(String packed) {"); 678 + println(" char [] map = new char[0x10000];"); 679 + println(" int i = 0; /* index in packed string */"); 680 + println(" int j = 0; /* index in unpacked array */"); 681 + println(" while (i < "+2*intervalls.Length+") {"); 682 + println(" int count = packed.charAt(i++);"); 683 + println(" char value = packed.charAt(i++);"); 684 + println(" do map[j++] = value; while (--count > 0);"); 685 + println(" }"); 686 + println(" return map;"); 687 + println(" }"); 688 + } 689 + } 690 + 691 + private void emitZZTrans() { 692 + 693 + int i,c; 694 + int n = 0; 695 + 696 + println(" /** "); 697 + println(" * The transition table of the DFA"); 698 + println(" */"); 699 + if (Options.emit_csharp) 700 + println(" private static readonly int[] ZZ_TRANS = new int[] {"); 701 + else 702 + println(" private static final int ZZ_TRANS [] = {"); //XXX 703 + 704 + print(" "); 705 + for (i = 0; i < dfa.numStates; i++) { 706 + 707 + if ( !rowKilled[i] ) { 708 + for (c = 0; c < dfa.numInput; c++) { 709 + if ( !colKilled[c] ) { 710 + if (n >= 10) { 711 + println(); 712 + print(" "); 713 + n = 0; 714 + } 715 + print( dfa.table[i][c] ); 716 + if (i != dfa.numStates-1 || c != dfa.numInput-1) 717 + print( ", "); 718 + n++; 719 + } 720 + } 721 + } 722 + } 723 + 724 + println(); 725 + println(" };"); 726 + } 727 + 728 + private void emitCharMapArrayUnPacked() { 729 + 730 + CharClasses cl = parser.getCharClasses(); 731 + intervalls = cl.getIntervalls(); 732 + 733 + println(""); 734 + println(" /** "); 735 + println(" * Translates characters to character classes"); 736 + println(" */"); 737 + if (Options.emit_csharp) 738 + println(" private static readonly char[] ZZ_CMAP = new char[] {"); 739 + else 740 + println(" private static final char [] ZZ_CMAP = {"); 741 + 742 + int n = 0; // numbers of entries in current line 743 + print(" "); 744 + 745 + int max = cl.getMaxCharCode(); 746 + int i = 0; 747 + while ( i < intervalls.Length && intervalls[i].start <= max ) { 748 + 749 + int end = Math.Min(intervalls[i].end, max); 750 + for (int c = intervalls[i].start; c <= end; c++) { 751 + 752 + if (Options.emit_csharp) 753 + print("(char)"); 754 + print(colMap[intervalls[i].charClass], 2); 755 + 756 + if (c < max) { 757 + print(", "); 758 + if ( ++n >= 16 ) { 759 + println(); 760 + print(" "); 761 + n = 0; 762 + } 763 + } 764 + } 765 + 766 + i++; 767 + } 768 + 769 + println(); 770 + println(" };"); 771 + println(); 772 + } 773 + 774 + private void emitCSharpStaticConstructor(bool include_char_map_array) 775 + { 776 + if (!Options.emit_csharp) 777 + return; 778 + 779 + println(" static "+scanner.className+"()"); 780 + println(" {"); 781 + if (include_char_map_array) 782 + println(" ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);"); 783 + println(" ZZ_ACTION = zzUnpackAction();"); 784 + println(" ZZ_ROWMAP = zzUnpackRowMap();"); 785 + println(" ZZ_TRANS = zzUnpackTrans();"); 786 + println(" ZZ_ATTRIBUTE = zzUnpackAttribute();"); 787 + println(" }"); 788 + println(""); 789 + } 790 + 791 + private void emitCharMapArray() { 792 + CharClasses cl = parser.getCharClasses(); 793 + 794 + if ( cl.getMaxCharCode() < 256 ) { 795 + emitCSharpStaticConstructor(false); 796 + emitCharMapArrayUnPacked(); 797 + return; 798 + } 799 + else 800 + emitCSharpStaticConstructor(true); 801 + 802 + // ignores cl.getMaxCharCode(), emits all intervalls instead 803 + 804 + intervalls = cl.getIntervalls(); 805 + 806 + println(""); 807 + println(" /** "); 808 + println(" * Translates characters to character classes"); 809 + println(" */"); 810 + if (Options.emit_csharp) 811 + println(" private static readonly ushort[] ZZ_CMAP_PACKED = new ushort[] {"); 812 + else 813 + println(" private static final String ZZ_CMAP_PACKED = "); 814 + 815 + int n = 0; // numbers of entries in current line 816 + if (Options.emit_csharp) 817 + print(" "); 818 + else 819 + print(" \""); 820 + 821 + int i = 0; 822 + while ( i < intervalls.Length-1 ) { 823 + int count = intervalls[i].end-intervalls[i].start+1; 824 + int value = colMap[intervalls[i].charClass]; 825 + 826 + printUC(count); 827 + printUC(value); 828 + 829 + if ( ++n >= 10 ) { 830 + if (Options.emit_csharp) 831 + { 832 + println(""); 833 + print(" "); 834 + } 835 + else 836 + { 837 + println("\"+"); 838 + print(" \""); 839 + } 840 + n = 0; 841 + } 842 + 843 + i++; 844 + } 845 + 846 + printUC(intervalls[i].end-intervalls[i].start+1); 847 + printUC(colMap[intervalls[i].charClass]); 848 + 849 + if (Options.emit_csharp) 850 + println(" 0 };"); // the extraneous 0 can't be avoided without restructuring printUC() 851 + else 852 + println("\";"); 853 + println(); 854 + 855 + println(" /** "); 856 + println(" * Translates characters to character classes"); 857 + println(" */"); 858 + if (Options.emit_csharp) 859 + println(" private static readonly char[] ZZ_CMAP;"); 860 + else 861 + println(" private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);"); 862 + println(); 863 + } 864 + 865 + 866 + /** 867 + * Print number as octal/unicode escaped string character. 868 + * 869 + * @param c the value to print 870 + * @prec 0 <= c <= 0xFFFF 871 + */ 872 + private void printUC(int c) { 873 + if (Options.emit_csharp) 874 + @out.Write(" "); 875 + 876 + if (c > 255) 877 + { 878 + if (Options.emit_csharp) 879 + { 880 + @out.Write("0x"); 881 + if (c < 0x1000) @out.Write("0"); 882 + @out.Write(Integer.toHexString(c)); 883 + } 884 + else 885 + { 886 + @out.Write("\\u"); 887 + if (c < 0x1000) @out.Write("0"); 888 + @out.Write(Integer.toHexString(c)); 889 + } 890 + } 891 + else { 892 + if (Options.emit_csharp) 893 + @out.Write(c.ToString()); 894 + else 895 + { 896 + @out.Write("\\"); 897 + @out.Write(Integer.toOctalString(c)); 898 + } 899 + } 900 + 901 + if (Options.emit_csharp) 902 + @out.Write(","); 903 + } 904 + 905 + 906 + private void emitRowMapArray() { 907 + println(""); 908 + println(" /** "); 909 + println(" * Translates a state to a row index in the transition table"); 910 + println(" */"); 911 + 912 + HiLowEmitter e = new HiLowEmitter("RowMap"); 913 + e.emitInit(); 914 + for (int i = 0; i < dfa.numStates; i++) { 915 + e.emit(rowMap[i]*numCols); 916 + } 917 + e.emitUnpack(); 918 + println(e.ToString()); 919 + } 920 + 921 + 922 + private void emitAttributes() { 923 + println(" /**"); 924 + println(" * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>"); 925 + println(" */"); 926 + 927 + CountEmitter e = new CountEmitter("Attribute"); 928 + e.emitInit(); 929 + 930 + int count = 1; 931 + int value = 0; 932 + if ( dfa.isFinal[0] ) value = FINAL; 933 + if ( dfa.isPushback[0] ) value|= PUSHBACK; 934 + if ( dfa.isLookEnd[0] ) value|= LOOKEND; 935 + if ( !isTransition[0] ) value|= NOLOOK; 936 + 937 + for (int i = 1; i < dfa.numStates; i++) { 938 + int attribute = 0; 939 + if ( dfa.isFinal[i] ) attribute = FINAL; 940 + if ( dfa.isPushback[i] ) attribute|= PUSHBACK; 941 + if ( dfa.isLookEnd[i] ) attribute|= LOOKEND; 942 + if ( !isTransition[i] ) attribute|= NOLOOK; 943 + 944 + if (value == attribute) { 945 + count++; 946 + } 947 + else { 948 + e.emit(count, value); 949 + count = 1; 950 + value = attribute; 951 + } 952 + } 953 + 954 + e.emit(count, value); 955 + e.emitUnpack(); 956 + 957 + println(e.ToString()); 958 + } 959 + 960 + 961 + private void emitClassCode() { 962 + if ( scanner.eofCode != null ) { 963 + println(" /** denotes if the user-EOF-code has already been executed */"); 964 + if (Options.emit_csharp) 965 + println(" private bool zzEOFDone;"); 966 + else 967 + println(" private boolean zzEOFDone;"); 968 + println(""); 969 + } 970 + 971 + if ( scanner.classCode != null ) { 972 + println(" /* user code: */"); 973 + println(scanner.classCode); 974 + } 975 + } 976 + 977 + private void emitConstructorDecl() { 978 + 979 + print(" "); 980 + 981 + if (Options.emit_csharp) 982 + { 983 + if ( scanner.isPublic ) 984 + print("public "); 985 + else 986 + print("internal "); 987 + print( scanner.className ); 988 + print("(TextReader @in)"); 989 + } 990 + else 991 + { 992 + if ( scanner.isPublic ) 993 + print("public "); 994 + print( scanner.className ); 995 + print("(java.io.Reader in)"); 996 + 997 + if ( scanner.initThrow != null ) 998 + { 999 + print(" throws "); 1000 + print( scanner.initThrow ); 1001 + } 1002 + } 1003 + 1004 + println(" {"); 1005 + 1006 + if ( scanner.initCode != null ) { 1007 + print(" "); 1008 + print( scanner.initCode ); 1009 + } 1010 + 1011 + println(" this.zzReader = @in;"); 1012 + 1013 + println(" }"); 1014 + println(); 1015 + 1016 + 1017 + if (Options.emit_csharp) 1018 + { 1019 + println(" /**"); 1020 + println(" * Creates a new scanner."); 1021 + println(" * There is also TextReader version of this constructor."); 1022 + println(" *"); 1023 + println(" * @param in the System.IO.Stream to read input from."); 1024 + println(" */"); 1025 + 1026 + print(" "); 1027 + if ( scanner.isPublic ) 1028 + print("public "); 1029 + else 1030 + print("internal "); 1031 + print( scanner.className ); 1032 + print("(Stream @in)"); 1033 + 1034 + println(" : this(new StreamReader(@in))"); 1035 + println(" {"); 1036 + println(" }"); 1037 + } 1038 + else 1039 + { 1040 + println(" /**"); 1041 + println(" * Creates a new scanner."); 1042 + println(" * There is also java.io.Reader version of this constructor."); 1043 + println(" *"); 1044 + println(" * @param in the java.io.Inputstream to read input from."); 1045 + println(" */"); 1046 + 1047 + print(" "); 1048 + if ( scanner.isPublic ) print("public "); 1049 + print( scanner.className ); 1050 + print("(java.io.InputStream in)"); 1051 + 1052 + if ( scanner.initThrow != null ) 1053 + { 1054 + print(" throws "); 1055 + print( scanner.initThrow ); 1056 + } 1057 + 1058 + println(" {"); 1059 + println(" this(new java.io.InputStreamReader(in));"); 1060 + println(" }"); 1061 + } 1062 + } 1063 + 1064 + 1065 + private void emitDoEOF() { 1066 + if ( scanner.eofCode == null ) return; 1067 + 1068 + println(" /**"); 1069 + println(" * Contains user EOF-code, which will be executed exactly once,"); 1070 + println(" * when the end of file is reached"); 1071 + println(" */"); 1072 + 1073 + print(" private void zzDoEOF()"); 1074 + 1075 + if (!Options.emit_csharp) 1076 + if ( scanner.eofThrow != null ) 1077 + { 1078 + print(" throws "); 1079 + print(scanner.eofThrow); 1080 + } 1081 + 1082 + println(" {"); 1083 + 1084 + println(" if (!zzEOFDone) {"); 1085 + println(" zzEOFDone = true;"); 1086 + println(" "+scanner.eofCode ); 1087 + println(" }"); 1088 + println(" }"); 1089 + println(""); 1090 + println(""); 1091 + } 1092 + 1093 + private void emitLexFunctHeader() { 1094 + 1095 + if (scanner.cupCompatible) { 1096 + // force public, because we have to implement java_cup.runtime.Symbol 1097 + print(" public "); 1098 + } 1099 + else { 1100 + print(" "+visibility+" "); 1101 + } 1102 + 1103 + if ( scanner.tokenType == null ) { 1104 + if ( scanner.isInteger ) 1105 + print( "int" ); 1106 + else 1107 + if ( scanner.isIntWrap ) 1108 + print( "Integer" ); 1109 + else 1110 + print( "Yytoken" ); 1111 + } 1112 + else 1113 + print( scanner.tokenType ); 1114 + 1115 + print(" "); 1116 + 1117 + print(scanner.functionName); 1118 + 1119 + if (Options.emit_csharp) 1120 + print("()"); 1121 + else 1122 + { 1123 + print("() throws java.io.IOException"); 1124 + 1125 + if ( scanner.lexThrow != null ) 1126 + { 1127 + print(", "); 1128 + print(scanner.lexThrow); 1129 + } 1130 + 1131 + if ( scanner.scanErrorException != null ) 1132 + { 1133 + print(", "); 1134 + print(scanner.scanErrorException); 1135 + } 1136 + } 1137 + 1138 + println(" {"); 1139 + 1140 + skel.emitNext(); 1141 + 1142 + if ( scanner.useRowMap ) { 1143 + println(" int [] zzTransL = ZZ_TRANS;"); 1144 + println(" int [] zzRowMapL = ZZ_ROWMAP;"); 1145 + println(" int [] zzAttrL = ZZ_ATTRIBUTE;"); 1146 + 1147 + } 1148 + 1149 + if ( scanner.lookAheadUsed ) { 1150 + println(" int zzPushbackPosL = zzPushbackPos = -1;"); 1151 + if (Options.emit_csharp) 1152 + println(" bool zzWasPushback;"); 1153 + else 1154 + println(" boolean zzWasPushback;"); 1155 + } 1156 + 1157 + skel.emitNext(); 1158 + 1159 + if ( scanner.charCount ) { 1160 + println(" yychar+= zzMarkedPosL-zzStartRead;"); 1161 + println(""); 1162 + } 1163 + 1164 + if ( scanner.lineCount || scanner.columnCount ) { 1165 + if (Options.emit_csharp) 1166 + println(" bool zzR = false;"); 1167 + else 1168 + println(" boolean zzR = false;"); 1169 + println(" for (zzCurrentPosL = zzStartRead; zzCurrentPosL < zzMarkedPosL;"); 1170 + println(" zzCurrentPosL++) {"); 1171 + println(" switch (zzBufferL[zzCurrentPosL]) {"); 1172 + println(" case '\\u000B':"); 1173 + println(" case '\\u000C':"); 1174 + println(" case '\\u0085':"); 1175 + println(" case '\\u2028':"); 1176 + println(" case '\\u2029':"); 1177 + if ( scanner.lineCount ) 1178 + println(" yyline++;"); 1179 + if ( scanner.columnCount ) 1180 + println(" yycolumn = 0;"); 1181 + println(" zzR = false;"); 1182 + println(" break;"); 1183 + println(" case '\\r':"); 1184 + if ( scanner.lineCount ) 1185 + println(" yyline++;"); 1186 + if ( scanner.columnCount ) 1187 + println(" yycolumn = 0;"); 1188 + println(" zzR = true;"); 1189 + println(" break;"); 1190 + println(" case '\\n':"); 1191 + println(" if (zzR)"); 1192 + println(" zzR = false;"); 1193 + println(" else {"); 1194 + if ( scanner.lineCount ) 1195 + println(" yyline++;"); 1196 + if ( scanner.columnCount ) 1197 + println(" yycolumn = 0;"); 1198 + println(" }"); 1199 + println(" break;"); 1200 + println(" default:"); 1201 + println(" zzR = false;"); 1202 + if ( scanner.columnCount ) 1203 + println(" yycolumn++;"); 1204 + if (Options.emit_csharp) 1205 + println(" break;"); 1206 + println(" }"); 1207 + println(" }"); 1208 + println(); 1209 + 1210 + if ( scanner.lineCount ) { 1211 + println(" if (zzR) {"); 1212 + println(" // peek one character ahead if it is \\n (if we have counted one line too much)"); 1213 + if (Options.emit_csharp) 1214 + println(" bool zzPeek;"); 1215 + else 1216 + println(" boolean zzPeek;"); 1217 + println(" if (zzMarkedPosL < zzEndReadL)"); 1218 + println(" zzPeek = zzBufferL[zzMarkedPosL] == '\\n';"); 1219 + println(" else if (zzAtEOF)"); 1220 + println(" zzPeek = false;"); 1221 + println(" else {"); 1222 + if (Options.emit_csharp) 1223 + println(" bool eof = zzRefill();"); 1224 + else 1225 + println(" boolean eof = zzRefill();"); 1226 + println(" zzMarkedPosL = zzMarkedPos;"); 1227 + println(" zzBufferL = zzBuffer;"); 1228 + println(" if (eof) "); 1229 + println(" zzPeek = false;"); 1230 + println(" else "); 1231 + println(" zzPeek = zzBufferL[zzMarkedPosL] == '\\n';"); 1232 + println(" }"); 1233 + println(" if (zzPeek) yyline--;"); 1234 + println(" }"); 1235 + } 1236 + } 1237 + 1238 + if ( scanner.bolUsed ) { 1239 + // zzMarkedPos > zzStartRead <=> last match was not empty 1240 + // if match was empty, last value of zzAtBOL can be used 1241 + // zzStartRead is always >= 0 1242 + println(" if (zzMarkedPosL > zzStartRead) {"); 1243 + println(" switch (zzBufferL[zzMarkedPosL-1]) {"); 1244 + println(" case '\\n':"); 1245 + println(" case '\\u000B':"); 1246 + println(" case '\\u000C':"); 1247 + println(" case '\\u0085':"); 1248 + println(" case '\\u2028':"); 1249 + println(" case '\\u2029':"); 1250 + println(" zzAtBOL = true;"); 1251 + println(" break;"); 1252 + println(" case '\\r': "); 1253 + println(" if (zzMarkedPosL < zzEndReadL)"); 1254 + println(" zzAtBOL = zzBufferL[zzMarkedPosL] != '\\n';"); 1255 + println(" else if (zzAtEOF)"); 1256 + println(" zzAtBOL = false;"); 1257 + println(" else {"); 1258 + if (Options.emit_csharp) 1259 + println(" bool eof = zzRefill();"); 1260 + else 1261 + println(" boolean eof = zzRefill();"); 1262 + println(" zzMarkedPosL = zzMarkedPos;"); 1263 + println(" zzBufferL = zzBuffer;"); 1264 + println(" if (eof) "); 1265 + println(" zzAtBOL = false;"); 1266 + println(" else "); 1267 + println(" zzAtBOL = zzBufferL[zzMarkedPosL] != '\\n';"); 1268 + println(" }"); 1269 + println(" break;"); 1270 + println(" default:"); 1271 + println(" zzAtBOL = false;"); 1272 + if (Options.emit_csharp) 1273 + println(" break;"); 1274 + println(" }"); 1275 + println(" }"); 1276 + } 1277 + 1278 + skel.emitNext(); 1279 + 1280 + if (scanner.bolUsed) { 1281 + println(" if (zzAtBOL)"); 1282 + println(" zzState = ZZ_LEXSTATE[zzLexicalState+1];"); 1283 + println(" else"); 1284 + println(" zzState = ZZ_LEXSTATE[zzLexicalState];"); 1285 + println(); 1286 + } 1287 + else { 1288 + println(" zzState = zzLexicalState;"); 1289 + println(); 1290 + } 1291 + 1292 + if (scanner.lookAheadUsed) 1293 + println(" zzWasPushback = false;"); 1294 + 1295 + skel.emitNext(); 1296 + } 1297 + 1298 + 1299 + private void emitGetRowMapNext() { 1300 + println(" int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];"); 1301 + if (Options.emit_csharp) 1302 + println(" if (zzNext == "+DFA.NO_TARGET+") goto zzForAction;"); 1303 + else 1304 + println(" if (zzNext == "+DFA.NO_TARGET+") break zzForAction;"); 1305 + println(" zzState = zzNext;"); 1306 + println(); 1307 + 1308 + println(" int zzAttributes = zzAttrL[zzState];"); 1309 + 1310 + if ( scanner.lookAheadUsed ) { 1311 + println(" if ( (zzAttributes & "+PUSHBACK+") == "+PUSHBACK+" )"); 1312 + println(" zzPushbackPosL = zzCurrentPosL;"); 1313 + println(); 1314 + } 1315 + 1316 + println(" if ( (zzAttributes & "+FINAL+") == "+FINAL+" ) {"); 1317 + if ( scanner.lookAheadUsed ) 1318 + println(" zzWasPushback = (zzAttributes & "+LOOKEND+") == "+LOOKEND+";"); 1319 + 1320 + skel.emitNext(); 1321 + 1322 + if (Options.emit_csharp) 1323 + println(" if ( (zzAttributes & "+NOLOOK+") == "+NOLOOK+" ) goto zzForAction;"); 1324 + else 1325 + println(" if ( (zzAttributes & "+NOLOOK+") == "+NOLOOK+" ) break zzForAction;"); 1326 + 1327 + skel.emitNext(); 1328 + } 1329 + 1330 + private void emitTransitionTable() { 1331 + transformTransitionTable(); 1332 + 1333 + println(" zzInput = zzCMapL[zzInput];"); 1334 + println(); 1335 + 1336 + if (Options.emit_csharp) 1337 + { 1338 + if ( scanner.lookAheadUsed ) 1339 + println(" bool zzPushback = false;"); 1340 + 1341 + println(" bool zzIsFinal = false;"); 1342 + println(" bool zzNoLookAhead = false;"); 1343 + println(); 1344 + } 1345 + else 1346 + { 1347 + if ( scanner.lookAheadUsed ) 1348 + println(" boolean zzPushback = false;"); 1349 + 1350 + println(" boolean zzIsFinal = false;"); 1351 + println(" boolean zzNoLookAhead = false;"); 1352 + println(); 1353 + } 1354 + 1355 + if (Options.emit_csharp) 1356 + { 1357 + println(" switch (zzState) {"); 1358 + println(" case 2147483647:"); 1359 + println(" zzForNext: break;"); 1360 + println(" case 2147483646:"); 1361 + println(" goto zzForNext;"); 1362 + } 1363 + else 1364 + println(" zzForNext: { switch (zzState) {"); 1365 + 1366 + for (int state = 0; state < dfa.numStates; state++) 1367 + if (isTransition[state]) emitState(state); 1368 + 1369 + println(" default:"); 1370 + println(" // if this is ever reached, there is a serious bug in JFlex/C# Flex"); 1371 + println(" zzScanError(ZZ_UNKNOWN_ERROR);"); 1372 + println(" break;"); 1373 + if (Options.emit_csharp) 1374 + println(" }"); 1375 + else 1376 + println(" } }"); 1377 + println(); 1378 + 1379 + println(" if ( zzIsFinal ) {"); 1380 + 1381 + if ( scanner.lookAheadUsed ) 1382 + println(" zzWasPushback = zzPushback;"); 1383 + 1384 + skel.emitNext(); 1385 + 1386 + if (Options.emit_csharp) 1387 + println(" if ( zzNoLookAhead ) goto zzForAction;"); 1388 + else 1389 + println(" if ( zzNoLookAhead ) break zzForAction;"); 1390 + 1391 + skel.emitNext(); 1392 + } 1393 + 1394 + 1395 + /** 1396 + * Escapes all " ' \ tabs and newlines 1397 + */ 1398 + private String escapify(String s) { 1399 + StringBuilder result = new StringBuilder(s.Length*2); 1400 + 1401 + for (int i = 0; i < s.Length; i++) { 1402 + char c = s[i]; 1403 + switch (c) { 1404 + case '\'': result.Append("\\\'"); break; 1405 + case '\"': result.Append("\\\""); break; 1406 + case '\\': result.Append("\\\\"); break; 1407 + case '\t': result.Append("\\t"); break; 1408 + case '\r': if (i+1 == s.Length || s[i+1] != '\n') result.Append("\"+ZZ_NL+\""); 1409 + break; 1410 + case '\n': result.Append("\"+ZZ_NL+\""); break; 1411 + default: result.Append(c); break; 1412 + } 1413 + } 1414 + 1415 + return result.ToString(); 1416 + } 1417 + 1418 + public void emitActionTable() { 1419 + int lastAction = 1; 1420 + int count = 0; 1421 + int value = 0; 1422 + 1423 + println(" /** "); 1424 + println(" * Translates DFA states to action switch labels."); 1425 + println(" */"); 1426 + CountEmitter e = new CountEmitter("Action"); 1427 + e.emitInit(); 1428 + 1429 + for (int i = 0; i < dfa.numStates; i++) { 1430 + int newVal; 1431 + if ( dfa.isFinal[i] ) { 1432 + Action action = dfa.action[i]; 1433 + Integer stored = (Integer) actionTable[action]; 1434 + if ( stored == null ) { 1435 + stored = new Integer(lastAction++); 1436 + actionTable[action] = stored; 1437 + } 1438 + newVal = stored.intValue(); 1439 + } 1440 + else { 1441 + newVal = 0; 1442 + } 1443 + 1444 + if (value == newVal) { 1445 + count++; 1446 + } 1447 + else { 1448 + if (count > 0) e.emit(count,value); 1449 + count = 1; 1450 + value = newVal; 1451 + } 1452 + } 1453 + 1454 + if (count > 0) e.emit(count,value); 1455 + 1456 + e.emitUnpack(); 1457 + println(e.ToString()); 1458 + } 1459 + 1460 + private void emitActions() { 1461 + println(" switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {"); 1462 + 1463 + int i = actionTable.Count+1; 1464 + IEnumerable actions = actionTable.Keys 1465 + .Cast<Action>() 1466 + .OrderBy(action => ((Integer)actionTable[action]).intValue()); 1467 + foreach (Action action in actions) { 1468 + int label = ((Integer) actionTable[action]).intValue(); 1469 + 1470 + println(" case "+label+": "); 1471 + 1472 + if (Options.emit_csharp) 1473 + { 1474 + println(" if (ZZ_SPURIOUS_WARNINGS_SUCK)"); 1475 + println(" {"); 1476 + 1477 + if ( scanner.debugOption ) 1478 + { 1479 + int @base = 0; 1480 + 1481 + print(" Console.WriteLine(\""); 1482 + if ( scanner.lineCount ) { print("line: {"+@base+"} "); @base++; } 1483 + if ( scanner.columnCount ) { print("col: {"+@base+"} "); @base++; } 1484 + println("match: --{"+@base+"}--\","); 1485 + print(" "); 1486 + if ( scanner.lineCount ) print("yyline+1, "); 1487 + if ( scanner.columnCount ) print("yycolumn+1, "); 1488 + println("yytext());"); 1489 + 1490 + print(" Console.WriteLine(\"action ["+action.priority+"] { "); 1491 + print(escapify(action.content)); 1492 + println(" }\");"); 1493 + } 1494 + 1495 + println("#line " + action.priority + " \"" + escapify(scanner.file) + "\""); 1496 + println(action.content); 1497 + println("#line default"); 1498 + println(" }"); 1499 + println(" break;"); 1500 + } 1501 + else 1502 + { 1503 + if ( scanner.debugOption ) 1504 + { 1505 + print(" System.out.println("); 1506 + if ( scanner.lineCount ) 1507 + print("\"line: \"+(yyline+1)+\" \"+"); 1508 + if ( scanner.columnCount ) 1509 + print("\"col: \"+(yycolumn+1)+\" \"+"); 1510 + println("\"match: --\"+yytext()+\"--\");"); 1511 + print(" System.out.println(\"action ["+action.priority+"] { "); 1512 + print(escapify(action.content)); 1513 + println(" }\");"); 1514 + } 1515 + 1516 + println(" { "+action.content); 1517 + println(" }"); 1518 + println(" case "+(i++)+": break;"); 1519 + } 1520 + } 1521 + } 1522 + 1523 + private void emitEOFVal() { 1524 + EOFActions eofActions = parser.getEOFActions(); 1525 + 1526 + if ( scanner.eofCode != null ) 1527 + println(" zzDoEOF();"); 1528 + 1529 + if ( eofActions.numActions() > 0 ) { 1530 + println(" switch (zzLexicalState) {"); 1531 + 1532 + IEnumerator stateNames = scanner.states.names(); 1533 + 1534 + // record lex states already emitted: 1535 + Hashtable used = new PrettyHashtable(); 1536 + 1537 + // pick a start value for break case labels. 1538 + // must be larger than any value of a lex state: 1539 + int last = dfa.numStates; 1540 + 1541 + while ( stateNames.MoveNext() ) { 1542 + String name = (String) stateNames.Current; 1543 + int num = scanner.states.getNumber(name).intValue(); 1544 + Action action = eofActions.getAction(num); 1545 + 1546 + // only emit code if the lex state is not redundant, so 1547 + // that case labels don't overlap 1548 + // (redundant = points to the same dfa state as another one). 1549 + // applies only to scanners that don't use BOL, because 1550 + // in BOL scanners lex states get mapped at runtime, so 1551 + // case labels will always be unique. 1552 + bool unused = true; 1553 + if (!scanner.bolUsed) { 1554 + Integer key = new Integer(dfa.lexState[2*num]); 1555 + unused = used[key] == null; 1556 + 1557 + if (!unused) 1558 + Out.warning("Lexical states <"+name+"> and <"+used[key]+"> are equivalent."); 1559 + else 1560 + used[key] = name; 1561 + } 1562 + 1563 + if (action != null && unused) 1564 + { 1565 + if (Options.emit_csharp) 1566 + { 1567 + println(" case "+name+":"); 1568 + println(" if (ZZ_SPURIOUS_WARNINGS_SUCK)"); 1569 + println(" {"); 1570 + println("#line " + action.priority + " \"" + scanner.file + "\""); 1571 + println(action.content); 1572 + println("#line default"); 1573 + println(" }"); 1574 + println(" break;"); 1575 + } 1576 + else 1577 + { 1578 + println(" case "+name+":"); 1579 + println(" { "+action.content+" }"); 1580 + println(" case "+(++last)+": break;"); 1581 + } 1582 + } 1583 + } 1584 + 1585 + println(" default:"); 1586 + } 1587 + 1588 + if (eofActions.getDefault() != null) 1589 + { 1590 + if (Options.emit_csharp) 1591 + { 1592 + Action dfl = eofActions.getDefault(); 1593 + 1594 + println(" if (ZZ_SPURIOUS_WARNINGS_SUCK)"); 1595 + println(" {"); 1596 + println("#line " + dfl.priority + " \"" + scanner.file + "\""); 1597 + println(dfl.content); 1598 + println("#line default"); 1599 + println(" }"); 1600 + } 1601 + else 1602 + { 1603 + println(" if (ZZ_SPURIOUS_WARNINGS_SUCK)"); 1604 + println(" { " + eofActions.getDefault().content + " }"); 1605 + } 1606 + println(" break;"); 1607 + } 1608 + else if ( scanner.eofVal != null ) 1609 + { 1610 + println(" if (ZZ_SPURIOUS_WARNINGS_SUCK)"); 1611 + println(" { " + scanner.eofVal + " }"); 1612 + println(" break;"); 1613 + } 1614 + else if ( scanner.isInteger ) 1615 + println(" return YYEOF;"); 1616 + else 1617 + println(" return null;"); 1618 + 1619 + if (eofActions.numActions() > 0) 1620 + println(" }"); 1621 + } 1622 + 1623 + private void emitState(int state) { 1624 + 1625 + println(" case "+state+":"); 1626 + println(" switch (zzInput) {"); 1627 + 1628 + int defaultTransition = getDefaultTransition(state); 1629 + 1630 + for (int next = 0; next < dfa.numStates; next++) { 1631 + 1632 + if ( next != defaultTransition && table[state][next] != null ) { 1633 + emitTransition(state, next); 1634 + } 1635 + } 1636 + 1637 + if ( defaultTransition != DFA.NO_TARGET && noTarget[state] != null ) { 1638 + emitTransition(state, DFA.NO_TARGET); 1639 + } 1640 + 1641 + emitDefaultTransition(state, defaultTransition); 1642 + 1643 + println(" }"); 1644 + println(""); 1645 + } 1646 + 1647 + private void emitTransition(int state, int nextState) 1648 + { 1649 + 1650 + CharSetEnumerator chars; 1651 + 1652 + if (nextState != DFA.NO_TARGET) 1653 + chars = table[state][nextState].characters(); 1654 + else 1655 + chars = noTarget[state].characters(); 1656 + 1657 + print(" case "); 1658 + print((int)chars.nextElement()); 1659 + print(": "); 1660 + 1661 + while ( chars.hasMoreElements() ) 1662 + { 1663 + println(); 1664 + print(" case "); 1665 + print((int)chars.nextElement()); 1666 + print(": "); 1667 + } 1668 + 1669 + if ( nextState != DFA.NO_TARGET ) 1670 + { 1671 + if ( dfa.isFinal[nextState] ) 1672 + print("zzIsFinal = true; "); 1673 + 1674 + if ( dfa.isPushback[nextState] ) 1675 + print("zzPushbackPosL = zzCurrentPosL; "); 1676 + 1677 + if ( dfa.isLookEnd[nextState] ) 1678 + print("zzPushback = true; "); 1679 + 1680 + if ( !isTransition[nextState] ) 1681 + print("zzNoLookAhead = true; "); 1682 + 1683 + if ( Options.emit_csharp ) 1684 + println("zzState = "+nextState+"; goto zzForNext;"); 1685 + else 1686 + println("zzState = "+nextState+"; break zzForNext;"); 1687 + } 1688 + else 1689 + { 1690 + if (Options.emit_csharp) 1691 + println("goto zzForAction;"); 1692 + else 1693 + println("break zzForAction;"); 1694 + } 1695 + } 1696 + 1697 + private void emitDefaultTransition(int state, int nextState) { 1698 + print(" default: "); 1699 + 1700 + if ( nextState != DFA.NO_TARGET ) 1701 + { 1702 + if ( dfa.isFinal[nextState] ) 1703 + print("zzIsFinal = true; "); 1704 + 1705 + if ( dfa.isPushback[nextState] ) 1706 + print("zzPushbackPosL = zzCurrentPosL; "); 1707 + 1708 + if ( dfa.isLookEnd[nextState] ) 1709 + print("zzPushback = true; "); 1710 + 1711 + if ( !isTransition[nextState] ) 1712 + print("zzNoLookAhead = true; "); 1713 + 1714 + if ( Options.emit_csharp ) 1715 + println("zzState = "+nextState+"; goto zzForNext;"); 1716 + else 1717 + println("zzState = "+nextState+"; break zzForNext;"); 1718 + } 1719 + else 1720 + { 1721 + if (Options.emit_csharp) 1722 + println( "goto zzForAction;" ); 1723 + else 1724 + println( "break zzForAction;" ); 1725 + } 1726 + } 1727 + 1728 + private void emitPushback() { 1729 + println(" if (zzWasPushback)"); 1730 + println(" zzMarkedPos = zzPushbackPosL;"); 1731 + } 1732 + 1733 + private int getDefaultTransition(int state) { 1734 + int max = 0; 1735 + 1736 + for (int i = 0; i < dfa.numStates; i++) { 1737 + if ( table[state][max] == null ) 1738 + max = i; 1739 + else 1740 + if ( table[state][i] != null && table[state][max].size() < table[state][i].size() ) 1741 + max = i; 1742 + } 1743 + 1744 + if ( table[state][max] == null ) return DFA.NO_TARGET; 1745 + if ( noTarget[state] == null ) return max; 1746 + 1747 + if ( table[state][max].size() < noTarget[state].size() ) 1748 + max = DFA.NO_TARGET; 1749 + 1750 + return max; 1751 + } 1752 + 1753 + // for switch statement: 1754 + private void transformTransitionTable() { 1755 + 1756 + int numInput = parser.getCharClasses().getNumClasses()+1; 1757 + 1758 + int i; 1759 + char j; 1760 + 1761 + table = new CharSet[dfa.numStates][]; 1762 + for (i=0; i < table.Length; i++) 1763 + table[i] = new CharSet[dfa.numStates]; 1764 + noTarget = new CharSet[dfa.numStates]; 1765 + 1766 + for (i = 0; i < dfa.numStates; i++) 1767 + for (j = (char)0; j < dfa.numInput; j++) { 1768 + 1769 + int nextState = dfa.table[i][j]; 1770 + 1771 + if ( nextState == DFA.NO_TARGET ) { 1772 + if ( noTarget[i] == null ) 1773 + noTarget[i] = new CharSet(numInput, colMap[j]); 1774 + else 1775 + noTarget[i].add(colMap[j]); 1776 + } 1777 + else { 1778 + if ( table[i][nextState] == null ) 1779 + table[i][nextState] = new CharSet(numInput, colMap[j]); 1780 + else 1781 + table[i][nextState].add(colMap[j]); 1782 + } 1783 + } 1784 + } 1785 + 1786 + private void findActionStates() { 1787 + isTransition = new bool [dfa.numStates]; 1788 + 1789 + for (int i = 0; i < dfa.numStates; i++) { 1790 + char j = (char)0; 1791 + while ( !isTransition[i] && j < dfa.numInput ) 1792 + isTransition[i] = dfa.table[i][j++] != DFA.NO_TARGET; 1793 + } 1794 + } 1795 + 1796 + 1797 + private void reduceColumns() { 1798 + colMap = new int [dfa.numInput]; 1799 + colKilled = new bool [dfa.numInput]; 1800 + 1801 + int i,j,k; 1802 + int translate = 0; 1803 + bool equal; 1804 + 1805 + numCols = dfa.numInput; 1806 + 1807 + for (i = 0; i < dfa.numInput; i++) { 1808 + 1809 + colMap[i] = i-translate; 1810 + 1811 + for (j = 0; j < i; j++) { 1812 + 1813 + // test for equality: 1814 + k = -1; 1815 + equal = true; 1816 + while (equal && ++k < dfa.numStates) 1817 + equal = dfa.table[k][i] == dfa.table[k][j]; 1818 + 1819 + if (equal) { 1820 + translate++; 1821 + colMap[i] = colMap[j]; 1822 + colKilled[i] = true; 1823 + numCols--; 1824 + break; 1825 + } // if 1826 + } // for j 1827 + } // for i 1828 + } 1829 + 1830 + private void reduceRows() { 1831 + rowMap = new int [dfa.numStates]; 1832 + rowKilled = new bool [dfa.numStates]; 1833 + 1834 + int i,j,k; 1835 + int translate = 0; 1836 + bool equal; 1837 + 1838 + numRows = dfa.numStates; 1839 + 1840 + // i is the state to add to the new table 1841 + for (i = 0; i < dfa.numStates; i++) { 1842 + 1843 + rowMap[i] = i-translate; 1844 + 1845 + // check if state i can be removed (i.e. already 1846 + // exists in entries 0..i-1) 1847 + for (j = 0; j < i; j++) { 1848 + 1849 + // test for equality: 1850 + k = -1; 1851 + equal = true; 1852 + while (equal && ++k < dfa.numInput) 1853 + equal = dfa.table[i][k] == dfa.table[j][k]; 1854 + 1855 + if (equal) { 1856 + translate++; 1857 + rowMap[i] = rowMap[j]; 1858 + rowKilled[i] = true; 1859 + numRows--; 1860 + break; 1861 + } // if 1862 + } // for j 1863 + } // for i 1864 + 1865 + } 1866 + 1867 + 1868 + /** 1869 + * Set up EOF code sectioin according to scanner.eofcode 1870 + */ 1871 + private void setupEOFCode() { 1872 + if (scanner.eofclose) { 1873 + scanner.eofCode = LexScan.conc(scanner.eofCode, " yyclose();"); 1874 + scanner.eofThrow = LexScan.concExc(scanner.eofThrow, "java.io.IOException"); 1875 + } 1876 + } 1877 + 1878 + 1879 + /** 1880 + * Main Emitter method. 1881 + */ 1882 + public void emit() { 1883 + 1884 + setupEOFCode(); 1885 + 1886 + if (scanner.functionName == null) 1887 + scanner.functionName = "yylex"; 1888 + 1889 + reduceColumns(); 1890 + findActionStates(); 1891 + 1892 + emitHeader(); 1893 + emitUserCode(); 1894 + emitClassName(); 1895 + 1896 + skel.emitNext(); 1897 + 1898 + if (Options.emit_csharp) 1899 + { 1900 + println(" private const int ZZ_BUFFERSIZE = "+scanner.bufferSize+";"); 1901 + 1902 + if (scanner.debugOption) 1903 + { 1904 + println(" private static readonly String ZZ_NL = Environment.NewLine;"); 1905 + } 1906 + 1907 + println(" /**"); 1908 + println(" * This is used in 'if' statements to eliminate dead code"); 1909 + println(" * warnings for 'break;' after the end of a user action"); 1910 + println(" * block of code. The Java version does this by emitting"); 1911 + println(" * a second 'case' which is impossible to reach. Since this"); 1912 + println(" * is impossible for the compiler to deduce during semantic"); 1913 + println(" * analysis, the warning is stifled. However, C# does not"); 1914 + println(" * permit 'case' blocks to flow into each other, so the C#"); 1915 + println(" * output mode needs a different approach. In this case,"); 1916 + println(" * the entire user code is wrapped up in an 'if' statement"); 1917 + println(" * whose condition is always true. No warning is emitted"); 1918 + println(" * because the compiler doesn't strictly propagate the value"); 1919 + println(" * of 'static readonly' fields, and thus does not semantically"); 1920 + println(" * detect the fact that the 'if' will always be true."); 1921 + println(" */"); 1922 + println(" public static readonly bool ZZ_SPURIOUS_WARNINGS_SUCK = true;"); 1923 + } 1924 + else 1925 + { 1926 + println(" private static final int ZZ_BUFFERSIZE = "+scanner.bufferSize+";"); 1927 + 1928 + if (scanner.debugOption) 1929 + { 1930 + println(" private static final String ZZ_NL = System.getProperty(\"line.separator\");"); 1931 + } 1932 + } 1933 + 1934 + skel.emitNext(); 1935 + 1936 + emitLexicalStates(); 1937 + 1938 + emitCharMapArray(); 1939 + 1940 + emitActionTable(); 1941 + 1942 + if (scanner.useRowMap) { 1943 + reduceRows(); 1944 + 1945 + emitRowMapArray(); 1946 + 1947 + if (scanner.packed) 1948 + emitDynamicInit(); 1949 + else 1950 + emitZZTrans(); 1951 + } 1952 + 1953 + skel.emitNext(); 1954 + 1955 + if (scanner.useRowMap) 1956 + emitAttributes(); 1957 + 1958 + skel.emitNext(); 1959 + 1960 + emitClassCode(); 1961 + 1962 + skel.emitNext(); 1963 + 1964 + emitConstructorDecl(); 1965 + 1966 + emitCharMapInitFunction(); 1967 + 1968 + skel.emitNext(); 1969 + 1970 + emitScanError(); 1971 + 1972 + skel.emitNext(); 1973 + 1974 + emitDoEOF(); 1975 + 1976 + skel.emitNext(); 1977 + 1978 + emitLexFunctHeader(); 1979 + 1980 + emitNextInput(); 1981 + 1982 + if (scanner.useRowMap) 1983 + emitGetRowMapNext(); 1984 + else 1985 + emitTransitionTable(); 1986 + 1987 + if (scanner.lookAheadUsed) 1988 + emitPushback(); 1989 + 1990 + skel.emitNext(); 1991 + 1992 + emitActions(); 1993 + 1994 + skel.emitNext(); 1995 + 1996 + emitEOFVal(); 1997 + 1998 + skel.emitNext(); 1999 + 2000 + emitNoMatch(); 2001 + 2002 + skel.emitNext(); 2003 + 2004 + emitMain(); 2005 + 2006 + skel.emitNext(); 2007 + 2008 + emitEpilogue(); 2009 + 2010 + @out.Flush(); 2011 + } 2012 + 2013 + } 2014 + }
+165
CSFlex/Core/ErrorMessages.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software); you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY); without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program); if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + using System.Collections; 27 + using System.IO; 28 + using System.Reflection; 29 + using System.Xml.Linq; 30 + 31 + // Modified in July 2026 by the Prexonite contributors to load the embedded 32 + // message catalogue without the .NET Framework ResX API. See COPYRIGHT. 33 + 34 + namespace CSFlex 35 + { 36 + 37 + 38 + /** 39 + * Central class for all kinds of C# Flex messages. 40 + * 41 + * [Is not yet used exclusively, but should be] 42 + * 43 + * @author Gerwin Klein 44 + * @version JFlex 1.4, $Revision: 2.7 $, $Date: 2004/04/12 10:07:47 $ 45 + * @author Jonathan Gilbert 46 + * @version CSFlex 1.4 47 + */ 48 + public class ErrorMessages { 49 + private String key; 50 + 51 + private static readonly Hashtable resources = new PrettyHashtable(); 52 + 53 + static ErrorMessages() 54 + { 55 + Assembly assembly = typeof(ErrorMessages).Assembly; 56 + using Stream resx_stream = assembly.GetManifestResourceStream("csflex.Messages.xml"); 57 + XDocument document = XDocument.Load(resx_stream); 58 + 59 + foreach (XElement data in document.Root.Elements("data")) 60 + { 61 + XAttribute name = data.Attribute("name"); 62 + XElement value = data.Element("value"); 63 + if (name != null && value != null) 64 + resources[name.Value] = value.Value; 65 + } 66 + } 67 + 68 + private ErrorMessages(String key) { 69 + this.key = key; 70 + } 71 + 72 + public static String get(ErrorMessages msg) { 73 + try { 74 + return resources[msg.key].ToString(); 75 + } catch { 76 + return '!' + msg.key + '!'; 77 + } 78 + } 79 + 80 + public static String get(ErrorMessages msg, String data) { 81 + return string.Format(get(msg), data); 82 + } 83 + 84 + public static String get(ErrorMessages msg, String data1, String data2) { 85 + return string.Format(get(msg), data1, data2); 86 + } 87 + 88 + public static String get(ErrorMessages msg, int data) { 89 + return string.Format(get(msg), data); 90 + } 91 + 92 + // typesafe enumeration (generated, do not edit) 93 + public static ErrorMessages UNTERMINATED_STR = new ErrorMessages("UNTERMINATED_STR"); 94 + public static ErrorMessages EOF_WO_ACTION = new ErrorMessages("EOF_WO_ACTION"); 95 + public static ErrorMessages EOF_SINGLERULE = new ErrorMessages("EOF_SINGLERULE"); 96 + public static ErrorMessages UNKNOWN_OPTION = new ErrorMessages("UNKNOWN_OPTION"); 97 + public static ErrorMessages UNEXPECTED_CHAR = new ErrorMessages("UNEXPECTED_CHAR"); 98 + public static ErrorMessages UNEXPECTED_NL = new ErrorMessages("UNEXPECTED_NL"); 99 + public static ErrorMessages LEXSTATE_UNDECL = new ErrorMessages("LEXSTATE_UNDECL"); 100 + public static ErrorMessages STATE_IDENT_EXP = new ErrorMessages("STATE_IDENT_EXP"); 101 + public static ErrorMessages REPEAT_ZERO = new ErrorMessages("REPEAT_ZERO"); 102 + public static ErrorMessages REPEAT_GREATER = new ErrorMessages("REPEAT_GREATER"); 103 + public static ErrorMessages REGEXP_EXPECTED = new ErrorMessages("REGEXP_EXPECTED"); 104 + public static ErrorMessages MACRO_UNDECL = new ErrorMessages("MACRO_UNDECL"); 105 + public static ErrorMessages CHARSET_2_SMALL = new ErrorMessages("CHARSET_2_SMALL"); 106 + public static ErrorMessages CS2SMALL_STRING = new ErrorMessages("CS2SMALL_STRING"); 107 + public static ErrorMessages CS2SMALL_CHAR = new ErrorMessages("CS2SMALL_CHAR"); 108 + public static ErrorMessages CHARCLASS_MACRO = new ErrorMessages("CHARCLASS_MACRO"); 109 + public static ErrorMessages UNKNOWN_SYNTAX = new ErrorMessages("UNKNOWN_SYNTAX"); 110 + public static ErrorMessages SYNTAX_ERROR = new ErrorMessages("SYNTAX_ERROR"); 111 + public static ErrorMessages NOT_AT_BOL = new ErrorMessages("NOT_AT_BOL"); 112 + public static ErrorMessages NO_MATCHING_BR = new ErrorMessages("NO_MATCHING_BR"); 113 + public static ErrorMessages EOF_IN_ACTION = new ErrorMessages("EOF_IN_ACTION"); 114 + public static ErrorMessages EOF_IN_COMMENT = new ErrorMessages("EOF_IN_COMMENT"); 115 + public static ErrorMessages EOF_IN_STRING = new ErrorMessages("EOF_IN_STRING"); 116 + public static ErrorMessages EOF_IN_MACROS = new ErrorMessages("EOF_IN_MACROS"); 117 + public static ErrorMessages EOF_IN_STATES = new ErrorMessages("EOF_IN_STATES"); 118 + public static ErrorMessages EOF_IN_REGEXP = new ErrorMessages("EOF_IN_REGEXP"); 119 + public static ErrorMessages UNEXPECTED_EOF = new ErrorMessages("UNEXPECTED_EOF"); 120 + public static ErrorMessages NO_LEX_SPEC = new ErrorMessages("NO_LEX_SPEC"); 121 + public static ErrorMessages NO_LAST_ACTION = new ErrorMessages("NO_LAST_ACTION"); 122 + public static ErrorMessages LOOKAHEAD_ERROR = new ErrorMessages("LOOKAHEAD_ERROR"); 123 + public static ErrorMessages NO_DIRECTORY = new ErrorMessages("NO_DIRECTORY"); 124 + public static ErrorMessages NO_SKEL_FILE = new ErrorMessages("NO_SKEL_FILE"); 125 + public static ErrorMessages WRONG_SKELETON = new ErrorMessages("WRONG_SKELETON"); 126 + public static ErrorMessages OUT_OF_MEMORY = new ErrorMessages("OUT_OF_MEMORY"); 127 + public static ErrorMessages QUIL_INITTHROW = new ErrorMessages("QUIL_INITTHROW"); 128 + public static ErrorMessages QUIL_EOFTHROW = new ErrorMessages("QUIL_EOFTHROW"); 129 + public static ErrorMessages QUIL_YYLEXTHROW = new ErrorMessages("QUIL_YYLEXTHROW"); 130 + public static ErrorMessages ZERO_STATES = new ErrorMessages("ZERO_STATES"); 131 + public static ErrorMessages NO_BUFFER_SIZE = new ErrorMessages("NO_BUFFER_SIZE"); 132 + public static ErrorMessages NOT_READABLE = new ErrorMessages("NOT_READABLE"); 133 + public static ErrorMessages FILE_CYCLE = new ErrorMessages("FILE_CYCLE"); 134 + public static ErrorMessages FILE_WRITE = new ErrorMessages("FILE_WRITE"); 135 + public static ErrorMessages QUIL_SCANERROR = new ErrorMessages("QUIL_SCANERROR"); 136 + public static ErrorMessages NEVER_MATCH = new ErrorMessages("NEVER_MATCH"); 137 + public static ErrorMessages QUIL_THROW = new ErrorMessages("QUIL_THROW"); 138 + public static ErrorMessages EOL_IN_CHARCLASS = new ErrorMessages("EOL_IN_CHARCLASS"); 139 + public static ErrorMessages QUIL_CUPSYM = new ErrorMessages("QUIL_CUPSYM"); 140 + public static ErrorMessages CUPSYM_AFTER_CUP = new ErrorMessages("CUPSYM_AFTER_CUP"); 141 + public static ErrorMessages ALREADY_RUNNING = new ErrorMessages("ALREADY_RUNNING"); 142 + public static ErrorMessages CANNOT_READ_SKEL = new ErrorMessages("CANNOT_READ_SKEL"); 143 + public static ErrorMessages READING_SKEL = new ErrorMessages("READING_SKEL"); 144 + public static ErrorMessages SKEL_IO_ERROR = new ErrorMessages("SKEL_IO_ERROR"); 145 + public static ErrorMessages SKEL_IO_ERROR_DEFAULT = new ErrorMessages("SKEL_IO_ERROR_DEFAULT"); 146 + public static ErrorMessages READING = new ErrorMessages("READING"); 147 + public static ErrorMessages CANNOT_OPEN = new ErrorMessages("CANNOT_OPEN"); 148 + public static ErrorMessages NFA_IS = new ErrorMessages("NFA_IS"); 149 + public static ErrorMessages NFA_STATES = new ErrorMessages("NFA_STATES"); 150 + public static ErrorMessages DFA_TOOK = new ErrorMessages("DFA_TOOK"); 151 + public static ErrorMessages DFA_IS = new ErrorMessages("DFA_IS"); 152 + public static ErrorMessages MIN_TOOK = new ErrorMessages("MIN_TOOK"); 153 + public static ErrorMessages MIN_DFA_IS = new ErrorMessages("MIN_DFA_IS"); 154 + public static ErrorMessages WRITE_TOOK = new ErrorMessages("WRITE_TOOK"); 155 + public static ErrorMessages TOTAL_TIME = new ErrorMessages("TOTAL_TIME"); 156 + public static ErrorMessages IO_ERROR = new ErrorMessages("IO_ERROR"); 157 + public static ErrorMessages THIS_IS_CSFLEX = new ErrorMessages("THIS_IS_CSFLEX"); 158 + public static ErrorMessages UNKNOWN_COMMANDLINE = new ErrorMessages("UNKNOWN_COMMANDLINE"); 159 + public static ErrorMessages MACRO_CYCLE = new ErrorMessages("MACRO_CYCLE"); 160 + public static ErrorMessages MACRO_DEF_MISSING = new ErrorMessages("MACRO_DEF_MISSING"); 161 + public static ErrorMessages PARSING_TOOK = new ErrorMessages("PARSING_TOOK"); 162 + public static ErrorMessages NFA_TOOK = new ErrorMessages("NFA_TOOK"); 163 + public static ErrorMessages NOT_CSHARP_SKELETON = new ErrorMessages("NOT_CSHARP_SKELETON"); 164 + } 165 + }
+79
CSFlex/Core/GeneratorCore.cs
··· 1 + /* 2 + * Modern in-memory entry point for C# Flex 1.4. 3 + * Copyright (C) 1998-2005 Gerwin Klein and Jonathan Gilbert. 4 + * Copyright (C) 2026 Prexonite contributors. 5 + * Distributed under GNU GPL version 2; see ../COPYRIGHT. 6 + */ 7 + 8 + using System.Collections.Immutable; 9 + using System.Text; 10 + 11 + namespace CSFlex; 12 + 13 + internal sealed record GenerationResult( 14 + string Source, 15 + ImmutableArray<GenerationDiagnostic> Diagnostics); 16 + 17 + internal static class GeneratorCore 18 + { 19 + internal const string Version = "1.4"; 20 + static readonly object Gate = new(); 21 + 22 + internal static GenerationResult Generate(string specification, string sourcePath) 23 + { 24 + lock (Gate) 25 + { 26 + Options.setDefaults(); 27 + Options.emit_csharp = true; 28 + Options.verbose = false; 29 + Options.progress = false; 30 + Skeleton.readNested(); 31 + Out.resetCounters(); 32 + 33 + try 34 + { 35 + using var reader = new StringReader(specification); 36 + var scanner = new LexScan(reader); 37 + var inputFile = new File(sourcePath); 38 + scanner.setFile(inputFile); 39 + var parser = new LexParse(scanner); 40 + var nfa = (NFA)parser.parse().value; 41 + Out.checkErrors(); 42 + 43 + var dfa = nfa.getDFA(); 44 + dfa.checkActions(scanner, parser); 45 + dfa.minimize(); 46 + 47 + var output = new StringBuilder(); 48 + using (var writer = new StringWriter( 49 + output, 50 + System.Globalization.CultureInfo.InvariantCulture)) 51 + { 52 + var emitter = new Emitter(inputFile, parser, dfa, writer); 53 + emitter.emit(); 54 + } 55 + 56 + return new GenerationResult( 57 + output.ToString(), 58 + Out.Diagnostics.ToImmutableArray()); 59 + } 60 + catch (ScannerException exception) 61 + { 62 + Out.error(exception.file, exception.message, exception.line, exception.column); 63 + } 64 + catch (MacroException exception) 65 + { 66 + Out.error(exception.Message); 67 + } 68 + catch (GeneratorException) 69 + { 70 + } 71 + catch (Exception exception) 72 + { 73 + Out.error(exception.Message); 74 + } 75 + 76 + return new GenerationResult(null, Out.Diagnostics.ToImmutableArray()); 77 + } 78 + } 79 + }
+43
CSFlex/Core/GeneratorException.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + namespace CSFlex 26 + { 27 + 28 + 29 + /** 30 + * Thrown when code generation has to be aborted. 31 + * 32 + * @author Gerwin Klein 33 + * @version JFlex 1.4, $Revision: 2.1 $, $Date: 2004/04/12 10:07:48 $ 34 + * @author Jonathan Gilbert 35 + * @version CSFlex 36 + */ 37 + public class GeneratorException: RuntimeException { 38 + 39 + public GeneratorException() : base("Generation aborted") { 40 + } 41 + 42 + } 43 + }
+117
CSFlex/Core/HiLowEmitter.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + 27 + namespace CSFlex 28 + { 29 + 30 + /** 31 + * HiLowEmitter 32 + * 33 + * @author Gerwin Klein 34 + * @version $Revision: 1.5 $, $Date: 2004/04/12 10:07:48 $ 35 + * @author Jonathan Gilbert 36 + * @version CSFlex 1.4 37 + */ 38 + public class HiLowEmitter: PackEmitter { 39 + 40 + /** number of entries in expanded array */ 41 + private int numEntries; 42 + 43 + /** 44 + * Create new emitter for values in [0, 0xFFFFFFFF] using hi/low encoding. 45 + * 46 + * @param name the name of the generated array 47 + */ 48 + public HiLowEmitter(String name): base(name) 49 + { 50 + } 51 + 52 + /** 53 + * Emits hi/low pair unpacking code for the generated array. 54 + * 55 + * @see CSFlex.PackEmitter#emitUnPack() 56 + */ 57 + public override void emitUnpack() { 58 + 59 + if (Options.emit_csharp) 60 + println(" 0 };"); // close array 61 + else 62 + println("\";"); // close last string chunk: 63 + nl(); 64 + println(" private static int [] zzUnpack"+name+"() {"); 65 + println(" int [] result = new int["+numEntries+"];"); 66 + println(" int offset = 0;"); 67 + 68 + for (int i = 0; i < chunks; i++) { 69 + println(" offset = zzUnpack"+name+"("+constName()+"_PACKED_"+i+", offset, result);"); 70 + } 71 + 72 + println(" return result;"); 73 + println(" }"); 74 + 75 + nl(); 76 + if (Options.emit_csharp) 77 + { 78 + println(" private static int zzUnpack"+name+"(ushort[] packed, int offset, int [] result) {"); 79 + println(" int i = 0; /* index in packed string */"); 80 + println(" int j = offset; /* index in unpacked array */"); 81 + println(" int l = packed.Length;"); 82 + println(" while (i + 1 < l) {"); 83 + println(" int high = packed[i++] << 16;"); 84 + println(" result[j++] = high | packed[i++];"); 85 + println(" }"); 86 + println(" return j;"); 87 + println(" }"); 88 + } 89 + else 90 + { 91 + println(" private static int zzUnpack"+name+"(String packed, int offset, int [] result) {"); 92 + println(" int i = 0; /* index in packed string */"); 93 + println(" int j = offset; /* index in unpacked array */"); 94 + println(" int l = packed.length();"); 95 + println(" while (i < l) {"); 96 + println(" int high = packed.charAt(i++) << 16;"); 97 + println(" result[j++] = high | packed.charAt(i++);"); 98 + println(" }"); 99 + println(" return j;"); 100 + println(" }"); 101 + } 102 + } 103 + 104 + /** 105 + * Emit one value using two characters. 106 + * 107 + * @param val the value to emit 108 + * @prec 0 <= val <= 0xFFFFFFFF 109 + */ 110 + public void emit(int val) { 111 + numEntries+= 1; 112 + breaks(); 113 + emitUC(val >> 16); 114 + emitUC(val & 0xFFFF); 115 + } 116 + } 117 + }
+470
CSFlex/Core/IntCharSet.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + using System.Collections; 27 + using System.Text; 28 + 29 + namespace CSFlex 30 + { 31 + 32 + /** 33 + * CharSet implemented with intervalls 34 + * 35 + * [fixme: optimizations possible] 36 + * 37 + * @author Gerwin Klein 38 + * @version JFlex 1.4, $Revision: 2.6 $, $Date: 2004/04/12 10:07:47 $ 39 + * @author Jonathan Gilbert 40 + * @version CSFlex 1.4 41 + */ 42 + public sealed class IntCharSet { 43 + 44 + private static readonly bool DEBUG = false; 45 + 46 + /* invariant: all intervals are disjoint, ordered */ 47 + private ArrayList intervalls; 48 + private int pos; 49 + 50 + public IntCharSet() { 51 + this.intervalls = new PrettyArrayList(); 52 + } 53 + 54 + public IntCharSet(char c) : this(new Interval(c,c)) 55 + { 56 + } 57 + 58 + public IntCharSet(Interval intervall) : this() 59 + { 60 + intervalls.Add(intervall); 61 + } 62 + 63 + public IntCharSet(ArrayList /* Interval */ chars) { 64 + int size = chars.Count; 65 + 66 + this.intervalls = new PrettyArrayList(size); 67 + 68 + for (int i = 0; i < size; i++) 69 + add( (Interval) chars[i] ); 70 + } 71 + 72 + 73 + 74 + 75 + /** 76 + * returns the index of the intervall that contains 77 + * the character c, -1 if there is no such intevall 78 + * 79 + * @prec: true 80 + * @post: -1 <= return < intervalls.size() && 81 + * (return > -1 --> intervalls[return].contains(c)) 82 + * 83 + * @param c the character 84 + * @return the index of the enclosing interval, -1 if no such interval 85 + */ 86 + private int indexOf(char c) { 87 + int start = 0; 88 + int end = intervalls.Count-1; 89 + 90 + while (start <= end) { 91 + int check = (start+end) / 2; 92 + Interval i = (Interval) intervalls[check]; 93 + 94 + if (start == end) 95 + return i.contains(c) ? start : -1; 96 + 97 + if (c < i.start) { 98 + end = check-1; 99 + continue; 100 + } 101 + 102 + if (c > i.end) { 103 + start = check+1; 104 + continue; 105 + } 106 + 107 + return check; 108 + } 109 + 110 + return -1; 111 + } 112 + 113 + public IntCharSet add(IntCharSet set) { 114 + for (int i = 0; i < set.intervalls.Count; i++) 115 + add( (Interval) set.intervalls[i] ); 116 + return this; 117 + } 118 + 119 + public void add(Interval intervall) { 120 + 121 + int size = intervalls.Count; 122 + 123 + for (int i = 0; i < size; i++) { 124 + Interval elem = (Interval) intervalls[i]; 125 + 126 + if ( elem.end+1 < intervall.start ) continue; 127 + 128 + if ( elem.contains(intervall) ) return; 129 + 130 + if ( elem.start > intervall.end+1 ) { 131 + intervalls.Insert(i, new Interval(intervall)); 132 + return; 133 + } 134 + 135 + if (intervall.start < elem.start) 136 + elem.start = intervall.start; 137 + 138 + if (intervall.end <= elem.end) 139 + return; 140 + 141 + elem.end = intervall.end; 142 + 143 + i++; 144 + // delete all x with x.contains( intervall.end ) 145 + while (i < size) { 146 + Interval x = (Interval) intervalls[i]; 147 + if (x.start > elem.end+1) return; 148 + 149 + elem.end = x.end; 150 + intervalls.RemoveAt(i); 151 + size--; 152 + } 153 + return; 154 + } 155 + 156 + intervalls.Add(new Interval(intervall)); 157 + } 158 + 159 + public void add(char c) { 160 + int size = intervalls.Count; 161 + 162 + for (int i = 0; i < size; i++) { 163 + Interval elem = (Interval) intervalls[i]; 164 + if (elem.end+1 < c) continue; 165 + 166 + if (elem.contains(c)) return; // already there, nothing to do 167 + 168 + // assert(elem.end+1 >= c && (elem.start > c || elem.end < c)); 169 + 170 + if (elem.start > c+1) { 171 + intervalls.Insert(i, new Interval(c,c)); 172 + return; 173 + } 174 + 175 + // assert(elem.end+1 >= c && elem.start <= c+1 && (elem.start > c || elem.end < c)); 176 + 177 + if (c+1 == elem.start) { 178 + elem.start = c; 179 + return; 180 + } 181 + 182 + // assert(elem.end+1 == c); 183 + elem.end = c; 184 + 185 + // merge with next interval if it contains c 186 + if (i >= size) return; 187 + Interval x = (Interval) intervalls[i+1]; 188 + if (x.start <= c+1) { 189 + elem.end = x.end; 190 + intervalls.RemoveAt(i+1); 191 + } 192 + return; 193 + } 194 + 195 + // end reached but nothing found -> append at end 196 + intervalls.Add(new Interval(c,c)); 197 + } 198 + 199 + 200 + public bool contains(char singleChar) { 201 + return indexOf(singleChar) >= 0; 202 + } 203 + 204 + /** 205 + * prec: intervall != null 206 + */ 207 + public bool contains(Interval intervall) { 208 + int index = indexOf(intervall.start); 209 + if (index < 0) return false; 210 + return ((Interval) intervalls[index]).contains(intervall); 211 + } 212 + 213 + public bool contains(IntCharSet set) { 214 + /* 215 + IntCharSet test = set.copy(); 216 + 217 + test.sub(this); 218 + 219 + return (test.numIntervalls() == 0); 220 + /*/ int i = 0; 221 + int j = 0; 222 + 223 + while (j < set.intervalls.Count) { 224 + Interval x = (Interval) intervalls[i]; 225 + Interval y = (Interval) set.intervalls[j]; 226 + 227 + if (x.contains(y)) j++; 228 + 229 + if (x.start > y.end) return false; 230 + if (x.end < y.start) i++; 231 + } 232 + 233 + return true; /* */ 234 + } 235 + 236 + 237 + /** 238 + * o instanceof Interval 239 + */ 240 + public override bool Equals(Object o) { 241 + IntCharSet set = (IntCharSet) o; 242 + if ( intervalls.Count != set.intervalls.Count ) return false; 243 + 244 + for (int i = 0; i < intervalls.Count; i++) { 245 + if ( !intervalls[i].Equals( set.intervalls[i]) ) 246 + return false; 247 + } 248 + 249 + return true; 250 + } 251 + 252 + public override int GetHashCode() 253 + { 254 + int hash = 0; 255 + for (int i=0; i < intervalls.Count; i++) 256 + { 257 + Interval elem = (Interval)intervalls[i]; 258 + 259 + ushort start = (ushort)elem.start; 260 + ushort end = (ushort)elem.end; 261 + 262 + hash ^= unchecked((int)((end << 16) | start)); 263 + } 264 + 265 + return hash; 266 + } 267 + 268 + 269 + private char min(char a, char b) 270 + { 271 + return a <= b ? a : b; 272 + } 273 + 274 + private char max(char a, char b) { 275 + return a >= b ? a : b; 276 + } 277 + 278 + /* intersection */ 279 + public IntCharSet and(IntCharSet set) { 280 + if (DEBUG) { 281 + Out.dump("intersection"); 282 + Out.dump("this : "+this); 283 + Out.dump("other : "+set); 284 + } 285 + 286 + IntCharSet result = new IntCharSet(); 287 + 288 + int i = 0; // index in this.intervalls 289 + int j = 0; // index in set.intervalls 290 + 291 + int size = intervalls.Count; 292 + int setSize = set.intervalls.Count; 293 + 294 + while (i < size && j < setSize) { 295 + Interval x = (Interval) this.intervalls[i]; 296 + Interval y = (Interval) set.intervalls[j]; 297 + 298 + if (x.end < y.start) { 299 + i++; 300 + continue; 301 + } 302 + 303 + if (y.end < x.start) { 304 + j++; 305 + continue; 306 + } 307 + 308 + result.intervalls.Add( 309 + new Interval( 310 + max(x.start, y.start), 311 + min(x.end, y.end) 312 + ) 313 + ); 314 + 315 + if (x.end >= y.end) j++; 316 + if (y.end >= x.end) i++; 317 + } 318 + 319 + if (DEBUG) { 320 + Out.dump("result: "+result); 321 + } 322 + 323 + return result; 324 + } 325 + 326 + /* complement */ 327 + /* prec: this.contains(set), set != null */ 328 + public void sub(IntCharSet set) { 329 + if (DEBUG) { 330 + Out.dump("complement"); 331 + Out.dump("this : "+this); 332 + Out.dump("other : "+set); 333 + } 334 + 335 + int i = 0; // index in this.intervalls 336 + int j = 0; // index in set.intervalls 337 + 338 + int setSize = set.intervalls.Count; 339 + 340 + while (i < intervalls.Count && j < setSize) { 341 + Interval x = (Interval) this.intervalls[i]; 342 + Interval y = (Interval) set.intervalls[j]; 343 + 344 + if (DEBUG) { 345 + Out.dump("this : "+this); 346 + Out.dump("this ["+i+"] : "+x); 347 + Out.dump("other ["+j+"] : "+y); 348 + } 349 + 350 + if (x.end < y.start) { 351 + i++; 352 + continue; 353 + } 354 + 355 + if (y.end < x.start) { 356 + j++; 357 + continue; 358 + } 359 + 360 + // x.end >= y.start && y.end >= x.start -> 361 + // x.end <= y.end && x.start >= y.start (prec) 362 + 363 + if ( x.start == y.start && x.end == y.end ) { 364 + intervalls.RemoveAt(i); 365 + j++; 366 + continue; 367 + } 368 + 369 + // x.end <= y.end && x.start >= y.start && 370 + // (x.end < y.end || x.start > y.start) -> 371 + // x.start < x.end 372 + 373 + if ( x.start == y.start ) { 374 + x.start = (char) (y.end+1); 375 + j++; 376 + continue; 377 + } 378 + 379 + if ( x.end == y.end ) { 380 + x.end = (char) (y.start-1); 381 + i++; 382 + j++; 383 + continue; 384 + } 385 + 386 + intervalls.Insert(i, new Interval(x.start, (char) (y.start-1))); 387 + x.start = (char) (y.end+1); 388 + 389 + i++; 390 + j++; 391 + } 392 + 393 + if (DEBUG) { 394 + Out.dump("result: "+this); 395 + } 396 + } 397 + 398 + public bool containsElements() { 399 + return intervalls.Count > 0; 400 + } 401 + 402 + public int numIntervalls() { 403 + return intervalls.Count; 404 + } 405 + 406 + // beware: depends on caller protocol, single user only 407 + public Interval getNext() { 408 + if (pos == intervalls.Count) pos = 0; 409 + return (Interval) intervalls[pos++]; 410 + } 411 + 412 + /** 413 + * Create a caseless version of this charset. 414 + * <p> 415 + * The caseless version contains all characters of this char set, 416 + * and additionally all lower/upper/title case variants of the 417 + * characters in this set. 418 + * 419 + * @return a caseless copy of this set 420 + */ 421 + public IntCharSet getCaseless() { 422 + IntCharSet n = copy(); 423 + 424 + int size = intervalls.Count; 425 + for (int i=0; i < size; i++) { 426 + Interval elem = (Interval) intervalls[i]; 427 + for (char c = elem.start; c <= elem.end; c++) { 428 + n.add(char.ToLower(c)); 429 + n.add(char.ToUpper(c)); 430 + //n.add(char.toTitleCase(c)); 431 + } 432 + } 433 + 434 + return n; 435 + } 436 + 437 + 438 + /** 439 + * Make a string representation of this char set. 440 + * 441 + * @return a string representing this char set. 442 + */ 443 + public override String ToString() { 444 + StringBuilder result = new StringBuilder("{ "); 445 + 446 + for (int i = 0; i < intervalls.Count; i++) 447 + result.Append( intervalls[i] ); 448 + 449 + result.Append(" }"); 450 + 451 + return result.ToString(); 452 + } 453 + 454 + 455 + /** 456 + * Return a (deep) copy of this char set 457 + * 458 + * @return the copy 459 + */ 460 + public IntCharSet copy() { 461 + IntCharSet result = new IntCharSet(); 462 + int size = intervalls.Count; 463 + for (int i=0; i < size; i++) { 464 + Interval iv = ((Interval) intervalls[i]).copy(); 465 + result.intervalls.Add(iv); 466 + } 467 + return result; 468 + } 469 + } 470 + }
+67
CSFlex/Core/IntPair.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + 27 + namespace CSFlex 28 + { 29 + 30 + 31 + /** 32 + * Simple pair of integers. 33 + * 34 + * Used in NFA to represent a partial NFA by its start and end state. 35 + * 36 + * @author Gerwin Klein 37 + * @version JFlex 1.4, $Revision: 2.1 $, $Date: 2004/04/12 10:07:48 $ 38 + * @author Jonathan Gilbert 39 + * @version CSFlex 1.4 40 + */ 41 + public sealed class IntPair { 42 + 43 + internal int start; 44 + internal int end; 45 + 46 + internal IntPair(int start, int end) { 47 + this.start = start; 48 + this.end = end; 49 + } 50 + 51 + public override int GetHashCode() { 52 + return end + (start << 8); 53 + } 54 + 55 + public override bool Equals(Object o) { 56 + if ( o is IntPair ) { 57 + IntPair p = (IntPair) o; 58 + return start == p.start && end == p.end; 59 + } 60 + return false; 61 + } 62 + 63 + public override String ToString() { 64 + return "("+start+","+end+")"; 65 + } 66 + } 67 + }
+181
CSFlex/Core/Interval.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + using System.Text; 27 + 28 + namespace CSFlex 29 + { 30 + 31 + 32 + /** 33 + * An intervall of characters with basic operations. 34 + * 35 + * @author Gerwin Klein 36 + * @version JFlex 1.4, $Revision: 2.3 $, $Date: 2004/04/12 10:07:47 $ 37 + * @author Jonathan Gilbert 38 + * @version CSFlex 1.4 39 + */ 40 + public sealed class Interval { 41 + 42 + /* start and end of the intervall */ 43 + public char start, end; 44 + 45 + 46 + /** 47 + * Constuct a new intervall from <code>start</code> to <code>end</code>. 48 + * 49 + * @param start first character the intervall should contain 50 + * @param end last character the intervall should contain 51 + */ 52 + public Interval(char start, char end) { 53 + this.start = start; 54 + this.end = end; 55 + } 56 + 57 + 58 + /** 59 + * Copy constructor 60 + */ 61 + public Interval(Interval other) { 62 + this.start = other.start; 63 + this.end = other.end; 64 + } 65 + 66 + 67 + /** 68 + * Return <code>true</code> iff <code>point</code> is contained in this intervall. 69 + * 70 + * @param point the character to check 71 + */ 72 + public bool contains(char point) { 73 + return start <= point && end >= point; 74 + } 75 + 76 + 77 + /** 78 + * Return <code>true</code> iff this intervall completely contains the 79 + * other one. 80 + * 81 + * @param other the other intervall 82 + */ 83 + public bool contains(Interval other) { 84 + return this.start <= other.start && this.end >= other.end; 85 + } 86 + 87 + 88 + /** 89 + * Return <code>true</code> if <code>o</code> is an intervall 90 + * with the same borders. 91 + * 92 + * @param o the object to check equality with 93 + */ 94 + public override bool Equals(Object o) { 95 + if ( o == this ) return true; 96 + if ( !(o is Interval) ) return false; 97 + 98 + Interval other = (Interval) o; 99 + return other.start == this.start && other.end == this.end; 100 + } 101 + 102 + public override int GetHashCode() 103 + { 104 + return unchecked((int)((((ushort)end) << 16) | (ushort)start)); 105 + } 106 + 107 + 108 + 109 + /** 110 + * Set a new last character 111 + * 112 + * @param end the new last character of this intervall 113 + */ 114 + public void setEnd(char end) 115 + { 116 + this.end = end; 117 + } 118 + 119 + 120 + /** 121 + * Set a new first character 122 + * 123 + * @param start the new first character of this intervall 124 + */ 125 + public void setStart(char start) { 126 + this.start = start; 127 + } 128 + 129 + 130 + /** 131 + * Check wether a character is printable. 132 + * 133 + * @param c the character to check 134 + */ 135 + private static bool isPrintable(char c) { 136 + // fixme: should make unicode test here 137 + return c > 31 && c < 127; 138 + } 139 + 140 + 141 + /** 142 + * Get a String representation of this intervall. 143 + * 144 + * @return a string <code>"[start-end]"</code> or 145 + * <code>"[start]"</code> (if there is only one character in 146 + * the intervall) where <code>start</code> and 147 + * <code>end</code> are either a number (the character code) 148 + * or something of the from <code>'a'</code>. 149 + */ 150 + public override String ToString() { 151 + StringBuilder result = new StringBuilder("["); 152 + 153 + if ( isPrintable(start) ) 154 + result.Append("'").Append(start).Append("'"); 155 + else 156 + result.Append( (int) start ); 157 + 158 + if (start != end) { 159 + result.Append("-"); 160 + 161 + if ( isPrintable(end) ) 162 + result.Append("'").Append(end).Append("'"); 163 + else 164 + result.Append( (int) end ); 165 + } 166 + 167 + result.Append("]"); 168 + return result.ToString(); 169 + } 170 + 171 + 172 + /** 173 + * Make a copy of this interval. 174 + * 175 + * @return the copy 176 + */ 177 + public Interval copy() { 178 + return new Interval(start,end); 179 + } 180 + } 181 + }
+2687
CSFlex/Core/LexParse.cs
··· 1 + 2 + //---------------------------------------------------- 3 + // The following code was generated by CUP v0.10l 4 + // 23/09/2004 4:14:16 AM 5 + //---------------------------------------------------- 6 + 7 + using System; 8 + using System.Collections; 9 + namespace CSFlex 10 + { 11 + 12 + /** CUP v0.10l generated parser. 13 + * @version 23/09/2004 4:14:16 AM 14 + */ 15 + public class LexParse: java_cup.runtime.lr_parser { 16 + 17 + /** Default constructor. */ 18 + public LexParse() { } 19 + 20 + /** Constructor which sets the default scanner. */ 21 + public LexParse(java_cup.runtime.Scanner s) : base(s) { } 22 + 23 + /** Production table. */ 24 + protected static readonly short[][] _production_table = 25 + unpackFromShorts(new short[] { 26 + 0, 73, 0, 2, 2, 4, 0, 2, 6, 6, 0, 2, 6, 27 + 8, 0, 2, 6, 2, 0, 2, 3, 2, 0, 2, 3, 4, 28 + 0, 2, 3, 3, 0, 2, 4, 3, 0, 2, 4, 3, 0, 29 + 2, 4, 6, 0, 2, 4, 4, 0, 2, 18, 4, 0, 2, 30 + 18, 9, 0, 2, 18, 8, 0, 2, 18, 3, 0, 2, 5, 31 + 7, 0, 2, 5, 5, 0, 2, 5, 3, 0, 2, 12, 3, 32 + 0, 2, 12, 4, 0, 2, 12, 2, 0, 2, 12, 5, 0, 33 + 2, 20, 4, 0, 2, 20, 3, 0, 2, 15, 5, 0, 2, 34 + 15, 2, 0, 2, 14, 5, 0, 2, 14, 3, 0, 2, 14, 35 + 4, 0, 2, 19, 3, 0, 2, 19, 2, 0, 2, 7, 5, 36 + 0, 2, 7, 3, 0, 2, 7, 3, 0, 2, 8, 4, 0, 37 + 2, 8, 3, 0, 2, 9, 3, 0, 2, 9, 4, 0, 2, 38 + 9, 4, 0, 2, 10, 4, 0, 2, 10, 4, 0, 2, 10, 39 + 4, 0, 2, 10, 5, 0, 2, 10, 6, 0, 2, 10, 5, 40 + 0, 2, 10, 3, 0, 2, 10, 3, 0, 2, 10, 3, 0, 41 + 2, 10, 3, 0, 2, 10, 3, 0, 2, 10, 3, 0, 2, 42 + 11, 4, 0, 2, 11, 5, 0, 2, 11, 5, 0, 2, 11, 43 + 6, 0, 2, 11, 6, 0, 2, 11, 7, 0, 2, 16, 4, 44 + 0, 2, 16, 3, 0, 2, 16, 4, 0, 2, 16, 3, 0, 45 + 2, 16, 4, 0, 2, 16, 3, 0, 2, 16, 4, 0, 2, 46 + 16, 3, 0, 2, 13, 5, 0, 2, 13, 3, 0, 2, 17, 47 + 3, 0, 2, 17, 3, 0, 2, 17, 3, 0, 2, 17, 3, 48 + 0, 2, 17, 3, 0, 2, 17, 3,0 }); 49 + 50 + /** Access to production table. */ 51 + public override short[][] production_table() {return _production_table;} 52 + 53 + /** Parse-action table. */ 54 + protected static readonly short[][] _action_table = 55 + unpackFromShorts(new short[] { 56 + 0, 108, 0, 6, 2, -2, 32, 4, 1, 2, 0, 12, 3, 57 + 8, 11, -3, 18, -3, 19, -3, 31, -3, 1, 2, 0, 4, 58 + 2, 6, 1, 2, 0, 4, 2, 1, 1, 2, 0, 10, 11, 59 + 12, 18, 9, 19, 11, 31, 10, 1, 2, 0, 10, 11, -5, 60 + 18, -5, 19, -5, 31, -5, 1, 2, 0, 10, 11, -6, 18, 61 + -6, 19, -6, 31, -6, 1, 2, 0, 4, 12, 108, 1, 2, 62 + 0, 10, 11, -7, 18, -7, 19, -7, 31, -7, 1, 2, 0, 63 + 40, 3, 15, 4, -24, 6, -24, 8, -24, 14, 14, 21, -24, 64 + 22, -24, 23, -24, 24, -24, 25, -24, 26, -24, 27, -24, 37, 65 + -24, 39, -24, 40, -24, 41, -24, 42, -24, 43, -24, 44, -24, 66 + 1, 2, 0, 10, 11, -4, 18, -4, 19, -4, 31, -4, 1, 67 + 2, 0, 4, 31, 95, 1, 2, 0, 46, 2, -16, 3, -16, 68 + 4, -16, 6, -16, 8, -16, 11, -16, 14, -16, 17, -16, 21, 69 + -16, 22, -16, 23, -16, 24, -16, 25, -16, 26, -16, 27, -16, 70 + 37, -16, 39, -16, 40, -16, 41, -16, 42, -16, 43, -16, 44, 71 + -16, 1, 2, 0, 46, 2, -13, 3, -13, 4, -13, 6, -13, 72 + 8, -13, 11, -13, 14, -13, 17, -13, 21, -13, 22, -13, 23, 73 + -13, 24, -13, 25, -13, 26, -13, 27, -13, 37, -13, 39, -13, 74 + 40, -13, 41, -13, 42, -13, 43, -13, 44, -13, 1, 2, 0, 75 + 44, 2, 0, 3, 15, 4, -24, 6, -24, 8, -24, 11, 92, 76 + 14, 91, 21, -24, 22, -24, 23, -24, 24, -24, 25, -24, 26, 77 + -24, 27, -24, 37, -24, 39, -24, 40, -24, 41, -24, 42, -24, 78 + 43, -24, 44, -24, 1, 2, 0, 36, 4, -29, 6, 19, 8, 79 + -29, 21, -29, 22, -29, 23, -29, 24, -29, 25, -29, 26, -29, 80 + 27, 21, 37, -29, 39, -29, 40, -29, 41, -29, 42, -29, 43, 81 + -29, 44, -29, 1, 2, 0, 32, 4, -28, 8, -28, 21, -28, 82 + 22, -28, 23, -28, 24, -28, 25, -28, 26, -28, 37, -28, 39, 83 + -28, 40, -28, 41, -28, 42, -28, 43, -28, 44, -28, 1, 2, 84 + 0, 32, 4, 23, 8, 35, 21, 30, 22, 41, 23, 38, 24, 85 + 25, 25, 37, 26, 42, 37, 43, 39, 24, 40, 31, 41, 40, 86 + 42, 27, 43, 29, 44, 39, 1, 2, 0, 4, 30, 22, 1, 87 + 2, 0, 46, 2, -15, 3, -15, 4, -15, 6, -15, 8, -15, 88 + 11, -15, 14, -15, 17, -15, 21, -15, 22, -15, 23, -15, 24, 89 + -15, 25, -15, 26, -15, 27, -15, 37, -15, 39, -15, 40, -15, 90 + 41, -15, 42, -15, 43, -15, 44, -15, 1, 2, 0, 32, 4, 91 + 23, 8, 35, 21, 30, 22, 41, 23, 38, 24, 25, 25, 37, 92 + 26, 42, 37, 43, 39, 24, 40, 31, 41, 40, 42, 27, 43, 93 + 29, 44, 39, 1, 2, 0, 50, 4, -48, 5, -48, 7, -48, 94 + 8, -48, 20, -48, 21, -48, 22, -48, 23, -48, 24, -48, 25, 95 + -48, 26, -48, 28, -48, 29, -48, 34, -48, 35, -48, 36, -48, 96 + 37, -48, 38, -48, 39, -48, 40, -48, 41, -48, 42, -48, 43, 97 + -48, 44, -48, 1, 2, 0, 52, 4, -69, 5, -69, 7, -69, 98 + 8, -69, 9, -69, 20, -69, 21, -69, 22, -69, 23, -69, 24, 99 + -69, 25, -69, 26, -69, 28, -69, 29, -69, 34, -69, 35, -69, 100 + 36, -69, 37, -69, 38, -69, 39, -69, 40, -69, 41, -69, 42, 101 + -69, 43, -69, 44, -69, 1, 2, 0, 50, 4, -45, 5, -45, 102 + 7, -45, 8, -45, 20, -45, 21, -45, 22, -45, 23, -45, 24, 103 + -45, 25, -45, 26, -45, 28, -45, 29, -45, 34, -45, 35, -45, 104 + 36, -45, 37, -45, 38, -45, 39, -45, 40, -45, 41, -45, 42, 105 + -45, 43, -45, 44, -45, 1, 2, 0, 50, 4, -49, 5, -49, 106 + 7, -49, 8, -49, 20, -49, 21, -49, 22, -49, 23, -49, 24, 107 + -49, 25, -49, 26, -49, 28, -49, 29, -49, 34, -49, 35, -49, 108 + 36, -49, 37, -49, 38, -49, 39, -49, 40, -49, 41, -49, 42, 109 + -49, 43, -49, 44, -49, 1, 2, 0, 42, 4, 23, 5, -31, 110 + 7, -31, 8, 35, 20, -31, 21, 30, 22, 41, 23, 38, 24, 111 + 25, 25, 37, 26, 42, 28, -31, 29, -31, 37, -31, 39, 24, 112 + 40, 31, 41, 40, 42, 27, 43, 29, 44, 39, 1, 2, 0, 113 + 50, 4, -47, 5, -47, 7, -47, 8, -47, 20, -47, 21, -47, 114 + 22, -47, 23, -47, 24, -47, 25, -47, 26, -47, 28, -47, 29, 115 + -47, 34, -47, 35, -47, 36, -47, 37, -47, 38, -47, 39, -47, 116 + 40, -47, 41, -47, 42, -47, 43, -47, 44, -47, 1, 2, 0, 117 + 52, 4, -66, 5, -66, 7, -66, 8, -66, 9, -66, 20, -66, 118 + 21, -66, 22, -66, 23, -66, 24, -66, 25, -66, 26, -66, 28, 119 + -66, 29, -66, 34, -66, 35, -66, 36, -66, 37, -66, 38, -66, 120 + 39, -66, 40, -66, 41, -66, 42, -66, 43, -66, 44, -66, 1, 121 + 2, 0, 30, 4, 23, 8, 35, 21, 30, 22, 41, 23, 38, 122 + 24, 25, 25, 37, 26, 42, 39, 24, 40, 31, 41, 40, 42, 123 + 27, 43, 29, 44, 39, 1, 2, 0, 50, 4, -46, 5, -46, 124 + 7, -46, 8, -46, 20, -46, 21, -46, 22, -46, 23, -46, 24, 125 + -46, 25, -46, 26, -46, 28, -46, 29, -46, 34, -46, 35, -46, 126 + 36, -46, 37, -46, 38, -46, 39, -46, 40, -46, 41, -46, 42, 127 + -46, 43, -46, 44, -46, 1, 2, 0, 50, 4, -35, 5, -35, 128 + 7, -35, 8, -35, 20, -35, 21, -35, 22, -35, 23, -35, 24, 129 + -35, 25, -35, 26, -35, 28, -35, 29, -35, 34, 81, 35, 82, 130 + 36, 84, 37, -35, 38, 83, 39, -35, 40, -35, 41, -35, 42, 131 + -35, 43, -35, 44, -35, 1, 2, 0, 42, 4, -34, 5, -34, 132 + 7, -34, 8, -34, 20, -34, 21, -34, 22, -34, 23, -34, 24, 133 + -34, 25, -34, 26, -34, 28, -34, 29, -34, 37, -34, 39, -34, 134 + 40, -34, 41, -34, 42, -34, 43, -34, 44, -34, 1, 2, 0, 135 + 26, 6, 62, 9, 58, 10, 61, 21, 30, 22, 41, 23, 38, 136 + 24, 25, 25, 37, 26, 42, 42, 57, 43, 59, 44, 63, 1, 137 + 2, 0, 12, 7, 48, 20, -19, 28, -19, 29, 46, 37, 47, 138 + 1, 2, 0, 52, 4, -70, 5, -70, 7, -70, 8, -70, 9, 139 + -70, 20, -70, 21, -70, 22, -70, 23, -70, 24, -70, 25, -70, 140 + 26, -70, 28, -70, 29, -70, 34, -70, 35, -70, 36, -70, 37, 141 + -70, 38, -70, 39, -70, 40, -70, 41, -70, 42, -70, 43, -70, 142 + 44, -70, 1, 2, 0, 52, 4, -68, 5, -68, 7, -68, 8, 143 + -68, 9, -68, 20, -68, 21, -68, 22, -68, 23, -68, 24, -68, 144 + 25, -68, 26, -68, 28, -68, 29, -68, 34, -68, 35, -68, 36, 145 + -68, 37, -68, 38, -68, 39, -68, 40, -68, 41, -68, 42, -68, 146 + 43, -68, 44, -68, 1, 2, 0, 50, 4, -44, 5, -44, 7, 147 + -44, 8, -44, 20, -44, 21, -44, 22, -44, 23, -44, 24, -44, 148 + 25, -44, 26, -44, 28, -44, 29, -44, 34, -44, 35, -44, 36, 149 + -44, 37, -44, 38, -44, 39, -44, 40, -44, 41, -44, 42, -44, 150 + 43, -44, 44, -44, 1, 2, 0, 30, 4, 23, 8, 35, 21, 151 + 30, 22, 41, 23, 38, 24, 25, 25, 37, 26, 42, 39, 24, 152 + 40, 31, 41, 40, 42, 27, 43, 29, 44, 39, 1, 2, 0, 153 + 52, 4, -67, 5, -67, 7, -67, 8, -67, 9, -67, 20, -67, 154 + 21, -67, 22, -67, 23, -67, 24, -67, 25, -67, 26, -67, 28, 155 + -67, 29, -67, 34, -67, 35, -67, 36, -67, 37, -67, 38, -67, 156 + 39, -67, 40, -67, 41, -67, 42, -67, 43, -67, 44, -67, 1, 157 + 2, 0, 52, 4, -71, 5, -71, 7, -71, 8, -71, 9, -71, 158 + 20, -71, 21, -71, 22, -71, 23, -71, 24, -71, 25, -71, 26, 159 + -71, 28, -71, 29, -71, 34, -71, 35, -71, 36, -71, 37, -71, 160 + 38, -71, 39, -71, 40, -71, 41, -71, 42, -71, 43, -71, 44, 161 + -71, 1, 2, 0, 14, 5, -32, 7, -32, 20, -32, 28, -32, 162 + 29, -32, 37, -32, 1, 2, 0, 42, 4, -37, 5, -37, 7, 163 + -37, 8, -37, 20, -37, 21, -37, 22, -37, 23, -37, 24, -37, 164 + 25, -37, 26, -37, 28, -37, 29, -37, 37, -37, 39, -37, 40, 165 + -37, 41, -37, 42, -37, 43, -37, 44, -37, 1, 2, 0, 6, 166 + 20, 54, 28, 55, 1, 2, 0, 32, 4, 23, 8, 35, 21, 167 + 30, 22, 41, 23, 38, 24, 25, 25, 37, 26, 42, 37, 43, 168 + 39, 24, 40, 31, 41, 40, 42, 27, 43, 29, 44, 39, 1, 169 + 2, 0, 30, 4, 23, 8, 35, 21, 30, 22, 41, 23, 38, 170 + 24, 25, 25, 37, 26, 42, 39, 24, 40, 31, 41, 40, 42, 171 + 27, 43, 29, 44, 39, 1, 2, 0, 6, 20, -17, 28, -17, 172 + 1, 2, 0, 42, 4, 23, 5, -30, 7, -30, 8, 35, 20, 173 + -30, 21, 30, 22, 41, 23, 38, 24, 25, 25, 37, 26, 42, 174 + 28, -30, 29, -30, 37, -30, 39, 24, 40, 31, 41, 40, 42, 175 + 27, 43, 29, 44, 39, 1, 2, 0, 42, 4, -33, 5, -33, 176 + 7, -33, 8, -33, 20, -33, 21, -33, 22, -33, 23, -33, 24, 177 + -33, 25, -33, 26, -33, 28, -33, 29, -33, 37, -33, 39, -33, 178 + 40, -33, 41, -33, 42, -33, 43, -33, 44, -33, 1, 2, 0, 179 + 10, 7, 52, 20, -18, 28, -18, 37, 47, 1, 2, 0, 6, 180 + 20, -20, 28, -20, 1, 2, 0, 46, 2, -14, 3, -14, 4, 181 + -14, 6, -14, 8, -14, 11, -14, 14, -14, 17, -14, 21, -14, 182 + 22, -14, 23, -14, 24, -14, 25, -14, 26, -14, 27, -14, 37, 183 + -14, 39, -14, 40, -14, 41, -14, 42, -14, 43, -14, 44, -14, 184 + 1, 2, 0, 4, 30, 56, 1, 2, 0, 46, 2, -22, 3, 185 + -22, 4, -22, 6, -22, 8, -22, 11, -22, 14, -22, 17, -22, 186 + 21, -22, 22, -22, 23, -22, 24, -22, 25, -22, 26, -22, 27, 187 + -22, 37, -22, 39, -22, 40, -22, 41, -22, 42, -22, 43, -22, 188 + 44, -22, 1, 2, 0, 46, 2, -21, 3, -21, 4, -21, 6, 189 + -21, 8, -21, 11, -21, 14, -21, 17, -21, 21, -21, 22, -21, 190 + 23, -21, 24, -21, 25, -21, 26, -21, 27, -21, 37, -21, 39, 191 + -21, 40, -21, 41, -21, 42, -21, 43, -21, 44, -21, 1, 2, 192 + 0, 24, 9, -65, 10, 79, 21, -65, 22, -65, 23, -65, 24, 193 + -65, 25, -65, 26, -65, 42, -65, 43, -65, 44, -65, 1, 2, 194 + 0, 50, 4, -50, 5, -50, 7, -50, 8, -50, 20, -50, 21, 195 + -50, 22, -50, 23, -50, 24, -50, 25, -50, 26, -50, 28, -50, 196 + 29, -50, 34, -50, 35, -50, 36, -50, 37, -50, 38, -50, 39, 197 + -50, 40, -50, 41, -50, 42, -50, 43, -50, 44, -50, 1, 2, 198 + 0, 22, 9, -61, 21, -61, 22, -61, 23, -61, 24, -61, 25, 199 + -61, 26, -61, 42, -61, 43, -61, 44, -61, 1, 2, 0, 22, 200 + 9, -57, 21, -57, 22, -57, 23, -57, 24, -57, 25, -57, 26, 201 + -57, 42, -57, 43, -57, 44, -57, 1, 2, 0, 20, 21, 30, 202 + 22, 41, 23, 38, 24, 25, 25, 37, 26, 42, 42, 57, 43, 203 + 59, 44, 63, 1, 2, 0, 24, 9, 71, 10, 72, 21, 30, 204 + 22, 41, 23, 38, 24, 25, 25, 37, 26, 42, 42, 57, 43, 205 + 59, 44, 63, 1, 2, 0, 22, 9, -63, 21, -63, 22, -63, 206 + 23, -63, 24, -63, 25, -63, 26, -63, 42, -63, 43, -63, 44, 207 + -63, 1, 2, 0, 22, 9, 69, 21, 30, 22, 41, 23, 38, 208 + 24, 25, 25, 37, 26, 42, 42, 57, 43, 68, 44, 70, 1, 209 + 2, 0, 22, 9, -59, 21, -59, 22, -59, 23, -59, 24, -59, 210 + 25, -59, 26, -59, 42, -59, 43, -59, 44, -59, 1, 2, 0, 211 + 22, 9, -56, 21, -56, 22, -56, 23, -56, 24, -56, 25, -56, 212 + 26, -56, 42, -56, 43, -56, 44, -56, 1, 2, 0, 22, 9, 213 + -58, 21, -58, 22, -58, 23, -58, 24, -58, 25, -58, 26, -58, 214 + 42, -58, 43, -58, 44, -58, 1, 2, 0, 22, 9, -60, 21, 215 + -60, 22, -60, 23, -60, 24, -60, 25, -60, 26, -60, 42, -60, 216 + 43, -60, 44, -60, 1, 2, 0, 50, 4, -51, 5, -51, 7, 217 + -51, 8, -51, 20, -51, 21, -51, 22, -51, 23, -51, 24, -51, 218 + 25, -51, 26, -51, 28, -51, 29, -51, 34, -51, 35, -51, 36, 219 + -51, 37, -51, 38, -51, 39, -51, 40, -51, 41, -51, 42, -51, 220 + 43, -51, 44, -51, 1, 2, 0, 22, 9, -62, 21, -62, 22, 221 + -62, 23, -62, 24, -62, 25, -62, 26, -62, 42, -62, 43, -62, 222 + 44, -62, 1, 2, 0, 50, 4, -52, 5, -52, 7, -52, 8, 223 + -52, 20, -52, 21, -52, 22, -52, 23, -52, 24, -52, 25, -52, 224 + 26, -52, 28, -52, 29, -52, 34, -52, 35, -52, 36, -52, 37, 225 + -52, 38, -52, 39, -52, 40, -52, 41, -52, 42, -52, 43, -52, 226 + 44, -52, 1, 2, 0, 20, 21, 30, 22, 41, 23, 38, 24, 227 + 25, 25, 37, 26, 42, 42, 57, 43, 59, 44, 63, 1, 2, 228 + 0, 22, 9, 74, 21, 30, 22, 41, 23, 38, 24, 25, 25, 229 + 37, 26, 42, 42, 57, 43, 68, 44, 70, 1, 2, 0, 50, 230 + 4, -53, 5, -53, 7, -53, 8, -53, 20, -53, 21, -53, 22, 231 + -53, 23, -53, 24, -53, 25, -53, 26, -53, 28, -53, 29, -53, 232 + 34, -53, 35, -53, 36, -53, 37, -53, 38, -53, 39, -53, 40, 233 + -53, 41, -53, 42, -53, 43, -53, 44, -53, 1, 2, 0, 22, 234 + 9, 76, 21, 30, 22, 41, 23, 38, 24, 25, 25, 37, 26, 235 + 42, 42, 57, 43, 68, 44, 70, 1, 2, 0, 50, 4, -55, 236 + 5, -55, 7, -55, 8, -55, 20, -55, 21, -55, 22, -55, 23, 237 + -55, 24, -55, 25, -55, 26, -55, 28, -55, 29, -55, 34, -55, 238 + 35, -55, 36, -55, 37, -55, 38, -55, 39, -55, 40, -55, 41, 239 + -55, 42, -55, 43, -55, 44, -55, 1, 2, 0, 22, 9, 78, 240 + 21, 30, 22, 41, 23, 38, 24, 25, 25, 37, 26, 42, 42, 241 + 57, 43, 68, 44, 70, 1, 2, 0, 50, 4, -54, 5, -54, 242 + 7, -54, 8, -54, 20, -54, 21, -54, 22, -54, 23, -54, 24, 243 + -54, 25, -54, 26, -54, 28, -54, 29, -54, 34, -54, 35, -54, 244 + 36, -54, 37, -54, 38, -54, 39, -54, 40, -54, 41, -54, 42, 245 + -54, 43, -54, 44, -54, 1, 2, 0, 4, 42, 80, 1, 2, 246 + 0, 22, 9, -64, 21, -64, 22, -64, 23, -64, 24, -64, 25, 247 + -64, 26, -64, 42, -64, 43, -64, 44, -64, 1, 2, 0, 6, 248 + 17, 86, 34, 85, 1, 2, 0, 50, 4, -38, 5, -38, 7, 249 + -38, 8, -38, 20, -38, 21, -38, 22, -38, 23, -38, 24, -38, 250 + 25, -38, 26, -38, 28, -38, 29, -38, 34, -38, 35, -38, 36, 251 + -38, 37, -38, 38, -38, 39, -38, 40, -38, 41, -38, 42, -38, 252 + 43, -38, 44, -38, 1, 2, 0, 50, 4, -40, 5, -40, 7, 253 + -40, 8, -40, 20, -40, 21, -40, 22, -40, 23, -40, 24, -40, 254 + 25, -40, 26, -40, 28, -40, 29, -40, 34, -40, 35, -40, 36, 255 + -40, 37, -40, 38, -40, 39, -40, 40, -40, 41, -40, 42, -40, 256 + 43, -40, 44, -40, 1, 2, 0, 50, 4, -39, 5, -39, 7, 257 + -39, 8, -39, 20, -39, 21, -39, 22, -39, 23, -39, 24, -39, 258 + 25, -39, 26, -39, 28, -39, 29, -39, 34, -39, 35, -39, 36, 259 + -39, 37, -39, 38, -39, 39, -39, 40, -39, 41, -39, 42, -39, 260 + 43, -39, 44, -39, 1, 2, 0, 4, 17, 87, 1, 2, 0, 261 + 50, 4, -41, 5, -41, 7, -41, 8, -41, 20, -41, 21, -41, 262 + 22, -41, 23, -41, 24, -41, 25, -41, 26, -41, 28, -41, 29, 263 + -41, 34, -41, 35, -41, 36, -41, 37, -41, 38, -41, 39, -41, 264 + 40, -41, 41, -41, 42, -41, 43, -41, 44, -41, 1, 2, 0, 265 + 50, 4, -42, 5, -42, 7, -42, 8, -42, 20, -42, 21, -42, 266 + 22, -42, 23, -42, 24, -42, 25, -42, 26, -42, 28, -42, 29, 267 + -42, 34, -42, 35, -42, 36, -42, 37, -42, 38, -42, 39, -42, 268 + 40, -42, 41, -42, 42, -42, 43, -42, 44, -42, 1, 2, 0, 269 + 42, 4, -36, 5, -36, 7, -36, 8, -36, 20, -36, 21, -36, 270 + 22, -36, 23, -36, 24, -36, 25, -36, 26, -36, 28, -36, 29, 271 + -36, 37, -36, 39, -36, 40, -36, 41, -36, 42, -36, 43, -36, 272 + 44, -36, 1, 2, 0, 6, 5, 90, 37, 47, 1, 2, 0, 273 + 50, 4, -43, 5, -43, 7, -43, 8, -43, 20, -43, 21, -43, 274 + 22, -43, 23, -43, 24, -43, 25, -43, 26, -43, 28, -43, 29, 275 + -43, 34, -43, 35, -43, 36, -43, 37, -43, 38, -43, 39, -43, 276 + 40, -43, 41, -43, 42, -43, 43, -43, 44, -43, 1, 2, 0, 277 + 4, 31, 95, 1, 2, 0, 4, 33, 94, 1, 2, 0, 46, 278 + 2, -10, 3, -10, 4, -10, 6, -10, 8, -10, 11, -10, 14, 279 + -10, 17, -10, 21, -10, 22, -10, 23, -10, 24, -10, 25, -10, 280 + 26, -10, 27, -10, 37, -10, 39, -10, 40, -10, 41, -10, 42, 281 + -10, 43, -10, 44, -10, 1, 2, 0, 4, 2, -1, 1, 2, 282 + 0, 6, 13, 101, 15, -26, 1, 2, 0, 4, 15, 97, 1, 283 + 2, 0, 38, 4, -23, 6, -23, 8, -23, 16, 98, 21, -23, 284 + 22, -23, 23, -23, 24, -23, 25, -23, 26, -23, 27, -23, 37, 285 + -23, 39, -23, 40, -23, 41, -23, 42, -23, 43, -23, 44, -23, 286 + 1, 2, 0, 40, 3, 15, 4, -24, 6, -24, 8, -24, 14, 287 + 14, 21, -24, 22, -24, 23, -24, 24, -24, 25, -24, 26, -24, 288 + 27, -24, 37, -24, 39, -24, 40, -24, 41, -24, 42, -24, 43, 289 + -24, 44, -24, 1, 2, 0, 42, 3, 15, 4, -24, 6, -24, 290 + 8, -24, 14, 91, 17, 100, 21, -24, 22, -24, 23, -24, 24, 291 + -24, 25, -24, 26, -24, 27, -24, 37, -24, 39, -24, 40, -24, 292 + 41, -24, 42, -24, 43, -24, 44, -24, 1, 2, 0, 46, 2, 293 + -11, 3, -11, 4, -11, 6, -11, 8, -11, 11, -11, 14, -11, 294 + 17, -11, 21, -11, 22, -11, 23, -11, 24, -11, 25, -11, 26, 295 + -11, 27, -11, 37, -11, 39, -11, 40, -11, 41, -11, 42, -11, 296 + 43, -11, 44, -11, 1, 2, 0, 6, 15, -27, 31, 95, 1, 297 + 2, 0, 4, 15, -25, 1, 2, 0, 4, 15, 104, 1, 2, 298 + 0, 38, 4, -23, 6, -23, 8, -23, 16, 105, 21, -23, 22, 299 + -23, 23, -23, 24, -23, 25, -23, 26, -23, 27, -23, 37, -23, 300 + 39, -23, 40, -23, 41, -23, 42, -23, 43, -23, 44, -23, 1, 301 + 2, 0, 40, 3, 15, 4, -24, 6, -24, 8, -24, 14, 14, 302 + 21, -24, 22, -24, 23, -24, 24, -24, 25, -24, 26, -24, 27, 303 + -24, 37, -24, 39, -24, 40, -24, 41, -24, 42, -24, 43, -24, 304 + 44, -24, 1, 2, 0, 42, 3, 15, 4, -24, 6, -24, 8, 305 + -24, 14, 91, 17, 107, 21, -24, 22, -24, 23, -24, 24, -24, 306 + 25, -24, 26, -24, 27, -24, 37, -24, 39, -24, 40, -24, 41, 307 + -24, 42, -24, 43, -24, 44, -24, 1, 2, 0, 46, 2, -12, 308 + 3, -12, 4, -12, 6, -12, 8, -12, 11, -12, 14, -12, 17, 309 + -12, 21, -12, 22, -12, 23, -12, 24, -12, 25, -12, 26, -12, 310 + 27, -12, 37, -12, 39, -12, 40, -12, 41, -12, 42, -12, 43, 311 + -12, 44, -12, 1, 2, 0, 40, 4, 23, 8, 35, 11, -9, 312 + 18, -9, 19, -9, 21, 30, 22, 41, 23, 38, 24, 25, 25, 313 + 37, 26, 42, 31, -9, 37, 43, 39, 24, 40, 31, 41, 40, 314 + 42, 27, 43, 29, 44, 39, 1, 2, 0, 6, 20, 110, 37, 315 + 47, 1, 2, 0, 10, 11, -8, 18, -8, 19, -8, 31, -8, 316 + 1, 2,0 }); 317 + 318 + /** Access to parse-action table. */ 319 + public override short[][] action_table() {return _action_table;} 320 + 321 + /** <code>reduce_goto</code> table. */ 322 + protected static readonly short[][] _reduce_table = 323 + unpackFromShorts(new short[] { 324 + 0, 108, 0, 4, 6, 4, 1, 1, 0, 4, 3, 6, 1, 325 + 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 4, 4, 12, 326 + 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 327 + 1, 0, 2, 1, 1, 0, 8, 5, 15, 15, 17, 18, 16, 328 + 1, 1, 0, 2, 1, 1, 0, 4, 14, 102, 1, 1, 0, 329 + 2, 1, 1, 0, 2, 1, 1, 0, 6, 5, 92, 15, 17, 330 + 1, 1, 0, 4, 19, 19, 1, 1, 0, 2, 1, 1, 0, 331 + 14, 7, 35, 8, 27, 9, 33, 10, 32, 11, 25, 17, 31, 332 + 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 14, 7, 333 + 88, 8, 27, 9, 33, 10, 32, 11, 25, 17, 31, 1, 1, 334 + 0, 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 335 + 2, 1, 1, 0, 10, 9, 49, 10, 32, 11, 25, 17, 31, 336 + 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 10, 9, 337 + 87, 10, 32, 11, 25, 17, 31, 1, 1, 0, 2, 1, 1, 338 + 0, 2, 1, 1, 0, 2, 1, 1, 0, 8, 13, 59, 16, 339 + 63, 17, 64, 1, 1, 0, 4, 12, 44, 1, 1, 0, 2, 340 + 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 10, 9, 341 + 43, 10, 32, 11, 25, 17, 31, 1, 1, 0, 2, 1, 1, 342 + 0, 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 343 + 4, 20, 52, 1, 1, 0, 14, 7, 50, 8, 27, 9, 33, 344 + 10, 32, 11, 25, 17, 31, 1, 1, 0, 12, 8, 48, 9, 345 + 33, 10, 32, 11, 25, 17, 31, 1, 1, 0, 2, 1, 1, 346 + 0, 10, 9, 49, 10, 32, 11, 25, 17, 31, 1, 1, 0, 347 + 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 2, 348 + 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 349 + 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 350 + 0, 2, 1, 1, 0, 8, 13, 59, 16, 76, 17, 64, 1, 351 + 1, 0, 8, 13, 59, 16, 72, 17, 64, 1, 1, 0, 2, 352 + 1, 1, 0, 6, 13, 65, 17, 66, 1, 1, 0, 2, 1, 353 + 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 354 + 0, 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 355 + 8, 13, 59, 16, 74, 17, 64, 1, 1, 0, 6, 13, 65, 356 + 17, 66, 1, 1, 0, 2, 1, 1, 0, 6, 13, 65, 17, 357 + 66, 1, 1, 0, 2, 1, 1, 0, 6, 13, 65, 17, 66, 358 + 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 359 + 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 360 + 0, 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 361 + 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 2, 362 + 1, 1, 0, 4, 14, 95, 1, 1, 0, 2, 1, 1, 0, 363 + 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 2, 364 + 1, 1, 0, 2, 1, 1, 0, 8, 5, 15, 15, 17, 18, 365 + 98, 1, 1, 0, 6, 5, 92, 15, 17, 1, 1, 0, 2, 366 + 1, 1, 0, 4, 14, 101, 1, 1, 0, 2, 1, 1, 0, 367 + 2, 1, 1, 0, 2, 1, 1, 0, 8, 5, 15, 15, 17, 368 + 18, 105, 1, 1, 0, 6, 5, 92, 15, 17, 1, 1, 0, 369 + 2, 1, 1, 0, 14, 7, 108, 8, 27, 9, 33, 10, 32, 370 + 11, 25, 17, 31, 1, 1, 0, 2, 1, 1, 0, 2, 1, 371 + 1,0 }); 372 + 373 + /** Access to <code>reduce_goto</code> table. */ 374 + public override short[][] reduce_table() {return _reduce_table;} 375 + 376 + /** Instance of action encapsulation class. */ 377 + protected CUPΔLexParseΔactions action_obj; 378 + 379 + /** Action encapsulation object initializer. */ 380 + protected override void init_actions() 381 + { 382 + action_obj = new CUPΔLexParseΔactions(this); 383 + } 384 + 385 + /** Invoke a user supplied parse action. */ 386 + public override java_cup.runtime.Symbol do_action( 387 + int act_num, 388 + java_cup.runtime.lr_parser parser, 389 + java_cup.Stack stack, 390 + int top) 391 + { 392 + /* call code in generated class */ 393 + return action_obj.CUPΔLexParseΔdo_action(act_num, parser, stack, top); 394 + } 395 + 396 + /** Indicates start state. */ 397 + public override int start_state() {return 0;} 398 + /** Indicates start production. */ 399 + public override int start_production() {return 0;} 400 + 401 + /** <code>EOF</code> Symbol index. */ 402 + public override int EOF_sym() {return 0;} 403 + 404 + /** <code>error</code> Symbol index. */ 405 + public override int error_sym() {return 1;} 406 + 407 + 408 + /** User initialization code. */ 409 + public override void user_init() 410 + { 411 + #line 850 "LexParse.cup" 412 + 413 + #line 850 "LexParse.cup" 414 + 415 + action_obj.scanner = this.scanner; 416 + #line default 417 + 418 + #line default 419 + } 420 + 421 + #line 815 "LexParse.cup" 422 + 423 + #line 815 "LexParse.cup" 424 + 425 + public LexScan scanner; 426 + 427 + public LexParse(LexScan scanner) : base(scanner) { 428 + this.scanner = scanner; 429 + } 430 + 431 + public CharClasses getCharClasses() { 432 + return action_obj.charClasses; 433 + } 434 + 435 + public EOFActions getEOFActions() { 436 + return action_obj.eofActions; 437 + } 438 + 439 + public override void report_error(String message, Object info) { 440 + if ( info is java_cup.runtime.Symbol ) { 441 + java_cup.runtime.Symbol s = (java_cup.runtime.Symbol) info; 442 + 443 + if (s.sym == sym.EOF) 444 + Out.error(ErrorMessages.UNEXPECTED_EOF); 445 + else 446 + Out.error(scanner.file, ErrorMessages.SYNTAX_ERROR, s.left, s.right); 447 + } 448 + else 449 + Out.error(ErrorMessages.UNKNOWN_SYNTAX); 450 + } 451 + 452 + public override void report_fatal_error(String message, Object info) { 453 + // report_error(message, info); 454 + throw new GeneratorException(); 455 + } 456 + 457 + #line default 458 + 459 + #line default 460 + } 461 + 462 + /** Cup generated class to encapsulate user supplied action code.*/ 463 + public class CUPΔLexParseΔactions { 464 + 465 + #line 27 "LexParse.cup" 466 + 467 + #line 27 "LexParse.cup" 468 + 469 + 470 + internal LexScan scanner; 471 + internal CharClasses charClasses = new CharClasses(127); 472 + internal RegExps regExps = new RegExps(); 473 + internal Macros macros = new Macros(); 474 + internal Integer stateNumber; 475 + internal Timer t = new Timer(); 476 + internal EOFActions eofActions = new EOFActions(); 477 + 478 + void fatalError(ErrorMessages message, int line, int col) { 479 + syntaxError(message, line, col); 480 + throw new GeneratorException(); 481 + } 482 + 483 + void fatalError(ErrorMessages message) { 484 + fatalError(message, scanner.currentLine(), -1); 485 + throw new GeneratorException(); 486 + } 487 + 488 + void syntaxError(ErrorMessages message) { 489 + Out.error(scanner.file, message, scanner.currentLine(), -1); 490 + } 491 + 492 + void syntaxError(ErrorMessages message, int line) { 493 + Out.error(scanner.file, message, line, -1); 494 + } 495 + 496 + void syntaxError(ErrorMessages message, int line, int col) { 497 + Out.error(scanner.file, message, line, col); 498 + } 499 + 500 + private static readonly char[] jletter_ranges = new char[] 501 + { 502 + '$', '$', 503 + 'A', 'Z', 504 + '_', '_', 505 + 'a', 'z', 506 + (char)162, (char)165, 507 + (char)170, (char)170, 508 + (char)181, (char)181, 509 + (char)186, (char)186, 510 + (char)192, (char)214, 511 + (char)216, (char)246, 512 + (char)248, (char)543, 513 + (char)546, (char)563, 514 + (char)592, (char)685, 515 + (char)688, (char)696, 516 + (char)699, (char)705, 517 + (char)720, (char)721, 518 + (char)736, (char)740, 519 + (char)750, (char)750, 520 + (char)890, (char)890, 521 + (char)902, (char)902, 522 + (char)904, (char)906, 523 + (char)908, (char)908, 524 + (char)910, (char)929, 525 + (char)931, (char)974, 526 + (char)976, (char)983, 527 + (char)986, (char)1011, 528 + (char)1024, (char)1153, 529 + (char)1164, (char)1220, 530 + (char)1223, (char)1224, 531 + (char)1227, (char)1228, 532 + (char)1232, (char)1269, 533 + (char)1272, (char)1273, 534 + (char)1329, (char)1366, 535 + (char)1369, (char)1369, 536 + (char)1377, (char)1415, 537 + (char)1488, (char)1514, 538 + (char)1520, (char)1522, 539 + (char)1569, (char)1594, 540 + (char)1600, (char)1610, 541 + (char)1649, (char)1747, 542 + (char)1749, (char)1749, 543 + (char)1765, (char)1766, 544 + (char)1786, (char)1788, 545 + (char)1808, (char)1808, 546 + (char)1810, (char)1836, 547 + (char)1920, (char)1957, 548 + (char)2309, (char)2361, 549 + (char)2365, (char)2365, 550 + (char)2384, (char)2384, 551 + (char)2392, (char)2401, 552 + (char)2437, (char)2444, 553 + (char)2447, (char)2448, 554 + (char)2451, (char)2472, 555 + (char)2474, (char)2480, 556 + (char)2482, (char)2482, 557 + (char)2486, (char)2489, 558 + (char)2524, (char)2525, 559 + (char)2527, (char)2529, 560 + (char)2544, (char)2547, 561 + (char)2565, (char)2570, 562 + (char)2575, (char)2576, 563 + (char)2579, (char)2600, 564 + (char)2602, (char)2608, 565 + (char)2610, (char)2611, 566 + (char)2613, (char)2614, 567 + (char)2616, (char)2617, 568 + (char)2649, (char)2652, 569 + (char)2654, (char)2654, 570 + (char)2674, (char)2676, 571 + (char)2693, (char)2699, 572 + (char)2701, (char)2701, 573 + (char)2703, (char)2705, 574 + (char)2707, (char)2728, 575 + (char)2730, (char)2736, 576 + (char)2738, (char)2739, 577 + (char)2741, (char)2745, 578 + (char)2749, (char)2749, 579 + (char)2768, (char)2768, 580 + (char)2784, (char)2784, 581 + (char)2821, (char)2828, 582 + (char)2831, (char)2832, 583 + (char)2835, (char)2856, 584 + (char)2858, (char)2864, 585 + (char)2866, (char)2867, 586 + (char)2870, (char)2873, 587 + (char)2877, (char)2877, 588 + (char)2908, (char)2909, 589 + (char)2911, (char)2913, 590 + (char)2949, (char)2954, 591 + (char)2958, (char)2960, 592 + (char)2962, (char)2965, 593 + (char)2969, (char)2970, 594 + (char)2972, (char)2972, 595 + (char)2974, (char)2975, 596 + (char)2979, (char)2980, 597 + (char)2984, (char)2986, 598 + (char)2990, (char)2997, 599 + (char)2999, (char)3001, 600 + (char)3077, (char)3084, 601 + (char)3086, (char)3088, 602 + (char)3090, (char)3112, 603 + (char)3114, (char)3123, 604 + (char)3125, (char)3129, 605 + (char)3168, (char)3169, 606 + (char)3205, (char)3212, 607 + (char)3214, (char)3216, 608 + (char)3218, (char)3240, 609 + (char)3242, (char)3251, 610 + (char)3253, (char)3257, 611 + (char)3294, (char)3294, 612 + (char)3296, (char)3297, 613 + (char)3333, (char)3340, 614 + (char)3342, (char)3344, 615 + (char)3346, (char)3368, 616 + (char)3370, (char)3385, 617 + (char)3424, (char)3425, 618 + (char)3461, (char)3478, 619 + (char)3482, (char)3505, 620 + (char)3507, (char)3515, 621 + (char)3517, (char)3517, 622 + (char)3520, (char)3526, 623 + (char)3585, (char)3632, 624 + (char)3634, (char)3635, 625 + (char)3647, (char)3654, 626 + (char)3713, (char)3714, 627 + (char)3716, (char)3716, 628 + (char)3719, (char)3720, 629 + (char)3722, (char)3722, 630 + (char)3725, (char)3725, 631 + (char)3732, (char)3735, 632 + (char)3737, (char)3743, 633 + (char)3745, (char)3747, 634 + (char)3749, (char)3749, 635 + (char)3751, (char)3751, 636 + (char)3754, (char)3755, 637 + (char)3757, (char)3760, 638 + (char)3762, (char)3763, 639 + (char)3773, (char)3773, 640 + (char)3776, (char)3780, 641 + (char)3782, (char)3782, 642 + (char)3804, (char)3805, 643 + (char)3840, (char)3840, 644 + (char)3904, (char)3911, 645 + (char)3913, (char)3946, 646 + (char)3976, (char)3979, 647 + (char)4096, (char)4129, 648 + (char)4131, (char)4135, 649 + (char)4137, (char)4138, 650 + (char)4176, (char)4181, 651 + (char)4256, (char)4293, 652 + (char)4304, (char)4342, 653 + (char)4352, (char)4441, 654 + (char)4447, (char)4514, 655 + (char)4520, (char)4601, 656 + (char)4608, (char)4614, 657 + (char)4616, (char)4678, 658 + (char)4680, (char)4680, 659 + (char)4682, (char)4685, 660 + (char)4688, (char)4694, 661 + (char)4696, (char)4696, 662 + (char)4698, (char)4701, 663 + (char)4704, (char)4742, 664 + (char)4744, (char)4744, 665 + (char)4746, (char)4749, 666 + (char)4752, (char)4782, 667 + (char)4784, (char)4784, 668 + (char)4786, (char)4789, 669 + (char)4792, (char)4798, 670 + (char)4800, (char)4800, 671 + (char)4802, (char)4805, 672 + (char)4808, (char)4814, 673 + (char)4816, (char)4822, 674 + (char)4824, (char)4846, 675 + (char)4848, (char)4878, 676 + (char)4880, (char)4880, 677 + (char)4882, (char)4885, 678 + (char)4888, (char)4894, 679 + (char)4896, (char)4934, 680 + (char)4936, (char)4954, 681 + (char)5024, (char)5108, 682 + (char)5121, (char)5740, 683 + (char)5743, (char)5750, 684 + (char)5761, (char)5786, 685 + (char)5792, (char)5866, 686 + (char)6016, (char)6067, 687 + (char)6176, (char)6263, 688 + (char)6272, (char)6312, 689 + (char)7680, (char)7835, 690 + (char)7840, (char)7929, 691 + (char)7936, (char)7957, 692 + (char)7960, (char)7965, 693 + (char)7968, (char)8005, 694 + (char)8008, (char)8013, 695 + (char)8016, (char)8023, 696 + (char)8025, (char)8025, 697 + (char)8027, (char)8027, 698 + (char)8029, (char)8029, 699 + (char)8031, (char)8061, 700 + (char)8064, (char)8116, 701 + (char)8118, (char)8124, 702 + (char)8126, (char)8126, 703 + (char)8130, (char)8132, 704 + (char)8134, (char)8140, 705 + (char)8144, (char)8147, 706 + (char)8150, (char)8155, 707 + (char)8160, (char)8172, 708 + (char)8178, (char)8180, 709 + (char)8182, (char)8188, 710 + (char)8255, (char)8256, 711 + (char)8319, (char)8319, 712 + (char)8352, (char)8363, 713 + (char)8450, (char)8450, 714 + (char)8455, (char)8455, 715 + (char)8458, (char)8467, 716 + (char)8469, (char)8469, 717 + (char)8473, (char)8477, 718 + (char)8484, (char)8484, 719 + (char)8486, (char)8486, 720 + (char)8488, (char)8488, 721 + (char)8490, (char)8493, 722 + (char)8495, (char)8497, 723 + (char)8499, (char)8505, 724 + (char)12293, (char)12294, 725 + (char)12337, (char)12341, 726 + (char)12353, (char)12436, 727 + (char)12445, (char)12446, 728 + (char)12449, (char)12538, 729 + (char)12540, (char)12542, 730 + (char)12549, (char)12588, 731 + (char)12593, (char)12686, 732 + (char)12704, (char)12727, 733 + (char)13312, (char)19893, 734 + (char)19968, (char)40869, 735 + (char)40960, (char)42124, 736 + (char)44032, (char)55203, 737 + (char)63744, (char)64045, 738 + (char)64256, (char)64262, 739 + (char)64275, (char)64279, 740 + (char)64285, (char)64285, 741 + (char)64287, (char)64296, 742 + (char)64298, (char)64310, 743 + (char)64312, (char)64316, 744 + (char)64318, (char)64318, 745 + (char)64320, (char)64321, 746 + (char)64323, (char)64324, 747 + (char)64326, (char)64433, 748 + (char)64467, (char)64829, 749 + (char)64848, (char)64911, 750 + (char)64914, (char)64967, 751 + (char)65008, (char)65019, 752 + (char)65075, (char)65076, 753 + (char)65101, (char)65103, 754 + (char)65129, (char)65129, 755 + (char)65136, (char)65138, 756 + (char)65140, (char)65140, 757 + (char)65142, (char)65276, 758 + (char)65284, (char)65284, 759 + (char)65313, (char)65338, 760 + (char)65343, (char)65343, 761 + (char)65345, (char)65370, 762 + (char)65382, (char)65470, 763 + (char)65474, (char)65479, 764 + (char)65482, (char)65487, 765 + (char)65490, (char)65495, 766 + (char)65498, (char)65500, 767 + (char)65504, (char)65505, 768 + (char)65509, (char)65510, 769 + }; 770 + 771 + private static readonly char[] jletterdigit_ranges = new char[] 772 + { 773 + (char)0, (char)8, 774 + (char)14, (char)27, 775 + '$', '$', 776 + '0', '9', 777 + 'A', 'Z', 778 + '_', '_', 779 + 'a', 'z', 780 + (char)127, (char)159, 781 + (char)162, (char)165, 782 + (char)170, (char)170, 783 + (char)178, (char)179, 784 + (char)181, (char)181, 785 + (char)185, (char)186, 786 + (char)192, (char)214, 787 + (char)216, (char)246, 788 + (char)248, (char)543, 789 + (char)546, (char)563, 790 + (char)592, (char)685, 791 + (char)688, (char)696, 792 + (char)699, (char)705, 793 + (char)720, (char)721, 794 + (char)736, (char)740, 795 + (char)750, (char)750, 796 + (char)768, (char)837, 797 + (char)864, (char)865, 798 + (char)890, (char)890, 799 + (char)902, (char)902, 800 + (char)904, (char)906, 801 + (char)908, (char)908, 802 + (char)910, (char)929, 803 + (char)931, (char)974, 804 + (char)976, (char)983, 805 + (char)986, (char)1011, 806 + (char)1024, (char)1153, 807 + (char)1155, (char)1158, 808 + (char)1164, (char)1220, 809 + (char)1223, (char)1224, 810 + (char)1227, (char)1228, 811 + (char)1232, (char)1269, 812 + (char)1272, (char)1273, 813 + (char)1329, (char)1366, 814 + (char)1369, (char)1369, 815 + (char)1377, (char)1415, 816 + (char)1425, (char)1465, 817 + (char)1467, (char)1469, 818 + (char)1471, (char)1471, 819 + (char)1473, (char)1474, 820 + (char)1476, (char)1476, 821 + (char)1488, (char)1514, 822 + (char)1520, (char)1522, 823 + (char)1569, (char)1594, 824 + (char)1600, (char)1618, 825 + (char)1632, (char)1641, 826 + (char)1648, (char)1747, 827 + (char)1749, (char)1756, 828 + (char)1759, (char)1768, 829 + (char)1770, (char)1773, 830 + (char)1776, (char)1788, 831 + (char)1808, (char)1808, 832 + (char)1810, (char)1836, 833 + (char)1920, (char)1957, 834 + (char)2305, (char)2307, 835 + (char)2309, (char)2361, 836 + (char)2364, (char)2381, 837 + (char)2384, (char)2388, 838 + (char)2392, (char)2403, 839 + (char)2406, (char)2415, 840 + (char)2433, (char)2435, 841 + (char)2437, (char)2444, 842 + (char)2447, (char)2448, 843 + (char)2451, (char)2472, 844 + (char)2474, (char)2480, 845 + (char)2482, (char)2482, 846 + (char)2486, (char)2489, 847 + (char)2492, (char)2492, 848 + (char)2494, (char)2500, 849 + (char)2503, (char)2504, 850 + (char)2507, (char)2509, 851 + (char)2519, (char)2519, 852 + (char)2524, (char)2525, 853 + (char)2527, (char)2531, 854 + (char)2534, (char)2551, 855 + (char)2553, (char)2553, 856 + (char)2562, (char)2562, 857 + (char)2565, (char)2570, 858 + (char)2575, (char)2576, 859 + (char)2579, (char)2600, 860 + (char)2602, (char)2608, 861 + (char)2610, (char)2611, 862 + (char)2613, (char)2614, 863 + (char)2616, (char)2617, 864 + (char)2620, (char)2620, 865 + (char)2622, (char)2626, 866 + (char)2631, (char)2632, 867 + (char)2635, (char)2637, 868 + (char)2649, (char)2652, 869 + (char)2654, (char)2654, 870 + (char)2662, (char)2676, 871 + (char)2689, (char)2691, 872 + (char)2693, (char)2699, 873 + (char)2701, (char)2701, 874 + (char)2703, (char)2705, 875 + (char)2707, (char)2728, 876 + (char)2730, (char)2736, 877 + (char)2738, (char)2739, 878 + (char)2741, (char)2745, 879 + (char)2748, (char)2757, 880 + (char)2759, (char)2761, 881 + (char)2763, (char)2765, 882 + (char)2768, (char)2768, 883 + (char)2784, (char)2784, 884 + (char)2790, (char)2799, 885 + (char)2817, (char)2819, 886 + (char)2821, (char)2828, 887 + (char)2831, (char)2832, 888 + (char)2835, (char)2856, 889 + (char)2858, (char)2864, 890 + (char)2866, (char)2867, 891 + (char)2870, (char)2873, 892 + (char)2876, (char)2883, 893 + (char)2887, (char)2893, 894 + (char)2902, (char)2903, 895 + (char)2908, (char)2909, 896 + (char)2911, (char)2913, 897 + (char)2918, (char)2927, 898 + (char)2946, (char)2947, 899 + (char)2949, (char)2954, 900 + (char)2958, (char)2960, 901 + (char)2962, (char)2965, 902 + (char)2969, (char)2970, 903 + (char)2972, (char)2972, 904 + (char)2974, (char)2975, 905 + (char)2979, (char)2980, 906 + (char)2984, (char)2986, 907 + (char)2990, (char)2997, 908 + (char)2999, (char)3001, 909 + (char)3006, (char)3140, 910 + (char)3142, (char)3144, 911 + (char)3146, (char)3149, 912 + (char)3157, (char)3158, 913 + (char)3168, (char)3169, 914 + (char)3174, (char)3183, 915 + (char)3202, (char)3203, 916 + (char)3205, (char)3212, 917 + (char)3214, (char)3216, 918 + (char)3218, (char)3240, 919 + (char)3242, (char)3251, 920 + (char)3253, (char)3257, 921 + (char)3262, (char)3268, 922 + (char)3270, (char)3272, 923 + (char)3274, (char)3277, 924 + (char)3285, (char)3286, 925 + (char)3294, (char)3294, 926 + (char)3296, (char)3297, 927 + (char)3302, (char)3311, 928 + (char)3330, (char)3331, 929 + (char)3333, (char)3340, 930 + (char)3342, (char)3344, 931 + (char)3346, (char)3368, 932 + (char)3370, (char)3385, 933 + (char)3390, (char)3395, 934 + (char)3398, (char)3400, 935 + (char)3402, (char)3405, 936 + (char)3415, (char)3415, 937 + (char)3424, (char)3425, 938 + (char)3430, (char)3439, 939 + (char)3461, (char)3478, 940 + (char)3482, (char)3505, 941 + (char)3507, (char)3515, 942 + (char)3517, (char)3517, 943 + (char)3520, (char)3526, 944 + (char)3585, (char)3642, 945 + (char)3647, (char)3662, 946 + (char)3664, (char)3673, 947 + (char)3713, (char)3714, 948 + (char)3716, (char)3716, 949 + (char)3719, (char)3720, 950 + (char)3722, (char)3722, 951 + (char)3725, (char)3725, 952 + (char)3732, (char)3735, 953 + (char)3737, (char)3743, 954 + (char)3745, (char)3747, 955 + (char)3749, (char)3749, 956 + (char)3751, (char)3751, 957 + (char)3754, (char)3755, 958 + (char)3757, (char)3769, 959 + (char)3771, (char)3773, 960 + (char)3776, (char)3780, 961 + (char)3782, (char)3782, 962 + (char)3784, (char)3789, 963 + (char)3792, (char)3801, 964 + (char)3804, (char)3805, 965 + (char)3840, (char)3840, 966 + (char)3864, (char)3865, 967 + (char)3872, (char)3881, 968 + (char)3893, (char)3893, 969 + (char)3895, (char)3895, 970 + (char)3897, (char)3897, 971 + (char)3902, (char)3911, 972 + (char)3913, (char)3946, 973 + (char)3953, (char)3979, 974 + (char)3984, (char)3989, 975 + (char)3991, (char)3991, 976 + (char)3993, (char)4013, 977 + (char)4017, (char)4023, 978 + (char)4025, (char)4025, 979 + (char)4096, (char)4129, 980 + (char)4131, (char)4135, 981 + (char)4137, (char)4138, 982 + (char)4176, (char)4181, 983 + (char)4256, (char)4293, 984 + (char)4304, (char)4342, 985 + (char)4352, (char)4441, 986 + (char)4447, (char)4514, 987 + (char)4520, (char)4601, 988 + (char)4608, (char)4614, 989 + (char)4616, (char)4678, 990 + (char)4680, (char)4680, 991 + (char)4682, (char)4685, 992 + (char)4688, (char)4694, 993 + (char)4696, (char)4696, 994 + (char)4698, (char)4701, 995 + (char)4704, (char)4742, 996 + (char)4744, (char)4744, 997 + (char)4746, (char)4749, 998 + (char)4752, (char)4782, 999 + (char)4784, (char)4784, 1000 + (char)4786, (char)4789, 1001 + (char)4792, (char)4798, 1002 + (char)4800, (char)4800, 1003 + (char)4802, (char)4805, 1004 + (char)4808, (char)4814, 1005 + (char)4816, (char)4822, 1006 + (char)4824, (char)4846, 1007 + (char)4848, (char)4878, 1008 + (char)4880, (char)4880, 1009 + (char)4882, (char)4885, 1010 + (char)4888, (char)4894, 1011 + (char)4896, (char)4934, 1012 + (char)4936, (char)4954, 1013 + (char)5024, (char)5108, 1014 + (char)5121, (char)5740, 1015 + (char)5743, (char)5750, 1016 + (char)5761, (char)5786, 1017 + (char)5792, (char)5866, 1018 + (char)6016, (char)6067, 1019 + (char)6176, (char)6263, 1020 + (char)6272, (char)6312, 1021 + (char)7680, (char)7835, 1022 + (char)7840, (char)7929, 1023 + (char)7936, (char)7957, 1024 + (char)7960, (char)7965, 1025 + (char)7968, (char)8005, 1026 + (char)8008, (char)8013, 1027 + (char)8016, (char)8023, 1028 + (char)8025, (char)8025, 1029 + (char)8027, (char)8027, 1030 + (char)8029, (char)8029, 1031 + (char)8031, (char)8061, 1032 + (char)8064, (char)8116, 1033 + (char)8118, (char)8124, 1034 + (char)8126, (char)8126, 1035 + (char)8130, (char)8132, 1036 + (char)8134, (char)8140, 1037 + (char)8144, (char)8147, 1038 + (char)8150, (char)8155, 1039 + (char)8160, (char)8172, 1040 + (char)8178, (char)8180, 1041 + (char)8182, (char)8188, 1042 + (char)8204, (char)8207, 1043 + (char)8234, (char)8238, 1044 + (char)8255, (char)8256, 1045 + (char)8298, (char)8304, 1046 + (char)8308, (char)8313, 1047 + (char)8319, (char)8329, 1048 + (char)8352, (char)8363, 1049 + (char)8400, (char)8412, 1050 + (char)8417, (char)8417, 1051 + (char)8450, (char)8450, 1052 + (char)8455, (char)8455, 1053 + (char)8458, (char)8467, 1054 + (char)8469, (char)8469, 1055 + (char)8473, (char)8477, 1056 + (char)8484, (char)8484, 1057 + (char)8486, (char)8486, 1058 + (char)8488, (char)8488, 1059 + (char)8490, (char)8493, 1060 + (char)8495, (char)8497, 1061 + (char)8499, (char)8505, 1062 + (char)8543, (char)8578, 1063 + (char)9312, (char)9371, 1064 + (char)9450, (char)9450, 1065 + (char)10102, (char)10131, 1066 + (char)12293, (char)12295, 1067 + (char)12321, (char)12335, 1068 + (char)12337, (char)12341, 1069 + (char)12353, (char)12436, 1070 + (char)12441, (char)12442, 1071 + (char)12445, (char)12446, 1072 + (char)12449, (char)12538, 1073 + (char)12540, (char)12542, 1074 + (char)12549, (char)12588, 1075 + (char)12593, (char)12686, 1076 + (char)12704, (char)12727, 1077 + (char)12928, (char)12937, 1078 + (char)13312, (char)19893, 1079 + (char)19968, (char)40869, 1080 + (char)40960, (char)42124, 1081 + (char)44032, (char)55203, 1082 + (char)63744, (char)64045, 1083 + (char)64256, (char)64262, 1084 + (char)64275, (char)64279, 1085 + (char)64285, (char)64285, 1086 + (char)64287, (char)64296, 1087 + (char)64298, (char)64310, 1088 + (char)64312, (char)64316, 1089 + (char)64318, (char)64318, 1090 + (char)64320, (char)64321, 1091 + (char)64323, (char)64324, 1092 + (char)64326, (char)64433, 1093 + (char)64467, (char)64829, 1094 + (char)64848, (char)64911, 1095 + (char)64914, (char)64967, 1096 + (char)65008, (char)65019, 1097 + (char)65075, (char)65076, 1098 + (char)65101, (char)65103, 1099 + (char)65129, (char)65129, 1100 + (char)65136, (char)65138, 1101 + (char)65140, (char)65140, 1102 + (char)65142, (char)65276, 1103 + (char)65279, (char)65279, 1104 + (char)65284, (char)65284, 1105 + (char)65296, (char)65305, 1106 + (char)65313, (char)65338, 1107 + (char)65343, (char)65343, 1108 + (char)65345, (char)65370, 1109 + (char)65382, (char)65470, 1110 + (char)65474, (char)65479, 1111 + (char)65482, (char)65487, 1112 + (char)65490, (char)65495, 1113 + (char)65498, (char)65500, 1114 + (char)65504, (char)65505, 1115 + (char)65509, (char)65510 1116 + 1117 + }; 1118 + 1119 + 1120 + 1121 + private static bool[] jletter_map, jletterdigit_map; 1122 + 1123 + private bool check(int type, char c) 1124 + { 1125 + switch (type) { 1126 + case sym.JLETTERCLASS: 1127 + if (jletter_map == null) 1128 + { 1129 + jletter_map = new bool[65536]; 1130 + for (int i=0; i < jletter_ranges.Length; i += 2) 1131 + for (char j=jletter_ranges[i]; j <= jletter_ranges[i + 1]; j++) 1132 + jletter_map[(int)j] = true; 1133 + } 1134 + return jletter_map[(int)c]; 1135 + 1136 + case sym.JLETTERDIGITCLASS: 1137 + if (jletterdigit_map == null) 1138 + { 1139 + jletterdigit_map = new bool[65536]; 1140 + for (int i=0; i < jletterdigit_ranges.Length; i += 2) 1141 + for (char j=jletterdigit_ranges[i]; j <= jletterdigit_ranges[i + 1]; j++) 1142 + jletterdigit_map[(int)j] = true; 1143 + } 1144 + return jletterdigit_map[(int)c]; 1145 + 1146 + case sym.LETTERCLASS: 1147 + return char.IsLetter(c); 1148 + 1149 + case sym.DIGITCLASS: 1150 + return char.IsDigit(c); 1151 + 1152 + case sym.UPPERCLASS: 1153 + return char.IsUpper(c); 1154 + 1155 + case sym.LOWERCLASS: 1156 + return char.IsLower(c); 1157 + 1158 + default: return false; 1159 + } 1160 + } 1161 + 1162 + private ArrayList makePreClass(int type) { 1163 + 1164 + ArrayList result = new PrettyArrayList(); 1165 + 1166 + char c = (char)0; 1167 + char start = (char)0; 1168 + char last = charClasses.getMaxCharCode(); 1169 + 1170 + bool prev, current; 1171 + 1172 + prev = check(type,'\u0000'); 1173 + 1174 + for (c = (char)1; c < last; c++) { 1175 + 1176 + current = check(type,c); 1177 + 1178 + if (!prev && current) start = c; 1179 + if (prev && !current) { 1180 + result.Add(new Interval(start, (char)(c-1))); 1181 + } 1182 + 1183 + prev = current; 1184 + } 1185 + 1186 + // the last iteration is moved out of the loop to 1187 + // avoid an endless loop if last == maxCharCode and 1188 + // last+1 == 0 1189 + current = check(type,c); 1190 + 1191 + if (!prev && current) result.Add(new Interval(c,c)); 1192 + if (prev && current) result.Add(new Interval(start, c)); 1193 + if (prev && !current) result.Add(new Interval(start, (char)(c-1))); 1194 + 1195 + return result; 1196 + } 1197 + 1198 + private RegExp makeRepeat(RegExp r, int n1, int n2, int line, int col) { 1199 + 1200 + if (n1 <= 0 && n2 <= 0) { 1201 + syntaxError(ErrorMessages.REPEAT_ZERO, line, col); 1202 + return null; 1203 + } 1204 + 1205 + if (n1 > n2) { 1206 + syntaxError(ErrorMessages.REPEAT_GREATER, line, col); 1207 + return null; 1208 + } 1209 + 1210 + int i; 1211 + RegExp result; 1212 + 1213 + if (n1 > 0) { 1214 + result = r; 1215 + n1--; n2--; // we need one concatenation less than the number of expressions to match 1216 + } 1217 + else { 1218 + result = new RegExp1(sym.QUESTION,r); 1219 + n2--; 1220 + } 1221 + 1222 + for (i = 0; i < n1; i++) 1223 + result = new RegExp2(sym.CONCAT, result, r); 1224 + 1225 + n2-= n1; 1226 + for (i = 0; i < n2; i++) 1227 + result = new RegExp2(sym.CONCAT, result, new RegExp1(sym.QUESTION,r)); 1228 + 1229 + return result; 1230 + } 1231 + 1232 + private RegExp makeNL() { 1233 + ArrayList list = new PrettyArrayList(); 1234 + list.Add(new Interval('\n','\r')); 1235 + list.Add(new Interval('\u0085','\u0085')); 1236 + list.Add(new Interval('\u2028','\u2029')); 1237 + 1238 + // assumption: line feeds are caseless 1239 + charClasses.makeClass(list, false); 1240 + charClasses.makeClass('\n', false); 1241 + charClasses.makeClass('\r', false); 1242 + 1243 + RegExp1 c = new RegExp1(sym.CCLASS, list); 1244 + char n = '\n'; 1245 + char r = '\r'; 1246 + 1247 + return new RegExp2(sym.BAR, 1248 + c, 1249 + new RegExp2(sym.CONCAT, 1250 + new RegExp1(sym.CHAR, r), 1251 + new RegExp1(sym.CHAR, n))); 1252 + } 1253 + 1254 + #line default 1255 + 1256 + #line default 1257 + private readonly LexParse parser; 1258 + 1259 + /** Constructor */ 1260 + internal CUPΔLexParseΔactions(LexParse parser) { 1261 + this.parser = parser; 1262 + } 1263 + 1264 + /** Method with the actual generated action code. */ 1265 + public java_cup.runtime.Symbol CUPΔLexParseΔdo_action( 1266 + int CUPΔLexParseΔact_num, 1267 + java_cup.runtime.lr_parser CUPΔLexParseΔparser, 1268 + java_cup.Stack CUPΔLexParseΔstack, 1269 + int CUPΔLexParseΔtop) 1270 + { 1271 + /* Symbol object for return from actions */ 1272 + java_cup.runtime.Symbol CUPΔLexParseΔresult; 1273 + 1274 + /* select the action based on the action number */ 1275 + switch (CUPΔLexParseΔact_num) 1276 + { 1277 + /*. . . . . . . . . . . . . . . . . . . .*/ 1278 + case 72: // preclass ::= LOWERCLASS 1279 + { 1280 + ArrayList RESULT = null; 1281 + 1282 + #line 1317 "LexParse.cup" 1283 + RESULT = makePreClass(sym.LOWERCLASS); 1284 + #line default 1285 + 1286 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(15/*preclass*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1287 + } 1288 + return CUPΔLexParseΔresult; 1289 + 1290 + /*. . . . . . . . . . . . . . . . . . . .*/ 1291 + case 71: // preclass ::= UPPERCLASS 1292 + { 1293 + ArrayList RESULT = null; 1294 + 1295 + #line 1315 "LexParse.cup" 1296 + RESULT = makePreClass(sym.UPPERCLASS); 1297 + #line default 1298 + 1299 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(15/*preclass*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1300 + } 1301 + return CUPΔLexParseΔresult; 1302 + 1303 + /*. . . . . . . . . . . . . . . . . . . .*/ 1304 + case 70: // preclass ::= DIGITCLASS 1305 + { 1306 + ArrayList RESULT = null; 1307 + 1308 + #line 1313 "LexParse.cup" 1309 + RESULT = makePreClass(sym.DIGITCLASS); 1310 + #line default 1311 + 1312 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(15/*preclass*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1313 + } 1314 + return CUPΔLexParseΔresult; 1315 + 1316 + /*. . . . . . . . . . . . . . . . . . . .*/ 1317 + case 69: // preclass ::= LETTERCLASS 1318 + { 1319 + ArrayList RESULT = null; 1320 + 1321 + #line 1311 "LexParse.cup" 1322 + RESULT = makePreClass(sym.LETTERCLASS); 1323 + #line default 1324 + 1325 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(15/*preclass*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1326 + } 1327 + return CUPΔLexParseΔresult; 1328 + 1329 + /*. . . . . . . . . . . . . . . . . . . .*/ 1330 + case 68: // preclass ::= JLETTERDIGITCLASS 1331 + { 1332 + ArrayList RESULT = null; 1333 + 1334 + #line 1309 "LexParse.cup" 1335 + RESULT = makePreClass(sym.JLETTERDIGITCLASS); 1336 + #line default 1337 + 1338 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(15/*preclass*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1339 + } 1340 + return CUPΔLexParseΔresult; 1341 + 1342 + /*. . . . . . . . . . . . . . . . . . . .*/ 1343 + case 67: // preclass ::= JLETTERCLASS 1344 + { 1345 + ArrayList RESULT = null; 1346 + 1347 + #line 1307 "LexParse.cup" 1348 + RESULT = makePreClass(sym.JLETTERCLASS); 1349 + #line default 1350 + 1351 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(15/*preclass*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1352 + } 1353 + return CUPΔLexParseΔresult; 1354 + 1355 + /*. . . . . . . . . . . . . . . . . . . .*/ 1356 + case 66: // classcontentelem ::= CHAR 1357 + { 1358 + Interval RESULT = null; 1359 + int cleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1360 + int cright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1361 + char c = (char)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1362 + 1363 + #line 1303 "LexParse.cup" 1364 + RESULT = new Interval(c, c); 1365 + #line default 1366 + 1367 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(11/*classcontentelem*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1368 + } 1369 + return CUPΔLexParseΔresult; 1370 + 1371 + /*. . . . . . . . . . . . . . . . . . . .*/ 1372 + case 65: // classcontentelem ::= CHAR DASH CHAR 1373 + { 1374 + Interval RESULT = null; 1375 + int c1left = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).left; 1376 + int c1right = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).right; 1377 + char c1 = (char)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).value; 1378 + int c2left = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1379 + int c2right = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1380 + char c2 = (char)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1381 + 1382 + #line 1301 "LexParse.cup" 1383 + RESULT = new Interval(c1, c2); 1384 + #line default 1385 + 1386 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(11/*classcontentelem*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1387 + } 1388 + return CUPΔLexParseΔresult; 1389 + 1390 + /*. . . . . . . . . . . . . . . . . . . .*/ 1391 + case 64: // classcontent ::= MACROUSE 1392 + { 1393 + ArrayList RESULT = null; 1394 + int identleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1395 + int identright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1396 + String ident = (String)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1397 + 1398 + #line 1295 "LexParse.cup" 1399 + 1400 + syntaxError(ErrorMessages.CHARCLASS_MACRO, identleft, identright); 1401 + 1402 + #line default 1403 + 1404 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(14/*classcontent*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1405 + } 1406 + return CUPΔLexParseΔresult; 1407 + 1408 + /*. . . . . . . . . . . . . . . . . . . .*/ 1409 + case 63: // classcontent ::= classcontent MACROUSE 1410 + { 1411 + ArrayList RESULT = null; 1412 + int listleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 1413 + int listright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 1414 + ArrayList list = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 1415 + int identleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1416 + int identright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1417 + String ident = (String)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1418 + 1419 + #line 1291 "LexParse.cup" 1420 + 1421 + syntaxError(ErrorMessages.CHARCLASS_MACRO, identleft, identright); 1422 + 1423 + #line default 1424 + 1425 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(14/*classcontent*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1426 + } 1427 + return CUPΔLexParseΔresult; 1428 + 1429 + /*. . . . . . . . . . . . . . . . . . . .*/ 1430 + case 62: // classcontent ::= STRING 1431 + { 1432 + ArrayList RESULT = null; 1433 + int sleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1434 + int sright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1435 + String s = (String)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1436 + 1437 + #line 1285 "LexParse.cup" 1438 + 1439 + RESULT = new PrettyArrayList(); 1440 + for (int i = 0; i < s.Length; i++) 1441 + RESULT.Add(new Interval(s[i],s[i])); 1442 + 1443 + #line default 1444 + 1445 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(14/*classcontent*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1446 + } 1447 + return CUPΔLexParseΔresult; 1448 + 1449 + /*. . . . . . . . . . . . . . . . . . . .*/ 1450 + case 61: // classcontent ::= classcontent STRING 1451 + { 1452 + ArrayList RESULT = null; 1453 + int listleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 1454 + int listright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 1455 + ArrayList list = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 1456 + int sleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1457 + int sright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1458 + String s = (String)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1459 + 1460 + #line 1279 "LexParse.cup" 1461 + 1462 + for (int i = 0; i < s.Length; i++) 1463 + list.Add(new Interval(s[i],s[i])); 1464 + RESULT = list; 1465 + 1466 + #line default 1467 + 1468 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(14/*classcontent*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1469 + } 1470 + return CUPΔLexParseΔresult; 1471 + 1472 + /*. . . . . . . . . . . . . . . . . . . .*/ 1473 + case 60: // classcontent ::= preclass 1474 + { 1475 + ArrayList RESULT = null; 1476 + int listleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1477 + int listright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1478 + ArrayList list = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1479 + 1480 + #line 1277 "LexParse.cup" 1481 + RESULT = list; 1482 + #line default 1483 + 1484 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(14/*classcontent*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1485 + } 1486 + return CUPΔLexParseΔresult; 1487 + 1488 + /*. . . . . . . . . . . . . . . . . . . .*/ 1489 + case 59: // classcontent ::= classcontent preclass 1490 + { 1491 + ArrayList RESULT = null; 1492 + int listleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 1493 + int listright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 1494 + ArrayList list = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 1495 + int plistleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1496 + int plistright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1497 + ArrayList plist = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1498 + 1499 + #line 1271 "LexParse.cup" 1500 + 1501 + for (IEnumerator e = plist.GetEnumerator(); e.MoveNext();) 1502 + list.Add(e.Current); 1503 + RESULT = list; 1504 + 1505 + #line default 1506 + 1507 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(14/*classcontent*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1508 + } 1509 + return CUPΔLexParseΔresult; 1510 + 1511 + /*. . . . . . . . . . . . . . . . . . . .*/ 1512 + case 58: // classcontent ::= classcontentelem 1513 + { 1514 + ArrayList RESULT = null; 1515 + int elemleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1516 + int elemright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1517 + Interval elem = (Interval)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1518 + 1519 + #line 1265 "LexParse.cup" 1520 + 1521 + ArrayList list = new PrettyArrayList(); 1522 + list.Add(elem); 1523 + RESULT = list; 1524 + 1525 + #line default 1526 + 1527 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(14/*classcontent*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1528 + } 1529 + return CUPΔLexParseΔresult; 1530 + 1531 + /*. . . . . . . . . . . . . . . . . . . .*/ 1532 + case 57: // classcontent ::= classcontent classcontentelem 1533 + { 1534 + ArrayList RESULT = null; 1535 + int listleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 1536 + int listright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 1537 + ArrayList list = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 1538 + int elemleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1539 + int elemright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1540 + Interval elem = (Interval)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1541 + 1542 + #line 1260 "LexParse.cup" 1543 + 1544 + list.Add(elem); 1545 + RESULT = list; 1546 + 1547 + #line default 1548 + 1549 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(14/*classcontent*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1550 + } 1551 + return CUPΔLexParseΔresult; 1552 + 1553 + /*. . . . . . . . . . . . . . . . . . . .*/ 1554 + case 56: // charclass ::= OPENCLASS HAT DASH classcontent CLOSECLASS 1555 + { 1556 + RegExp RESULT = null; 1557 + int listleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 1558 + int listright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 1559 + ArrayList list = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 1560 + int closeleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1561 + int closeright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1562 + Object close = (Object)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1563 + 1564 + #line 1247 "LexParse.cup" 1565 + 1566 + try { 1567 + list.Add(new Interval('-','-')); 1568 + charClasses.makeClassNot(list, Options.jlex && scanner.caseless); 1569 + } 1570 + catch (CharClassException) { 1571 + syntaxError(ErrorMessages.CHARSET_2_SMALL, closeleft, closeright); 1572 + } 1573 + RESULT = new RegExp1(sym.CCLASSNOT,list); 1574 + 1575 + #line default 1576 + 1577 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(9/*charclass*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-4)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1578 + } 1579 + return CUPΔLexParseΔresult; 1580 + 1581 + /*. . . . . . . . . . . . . . . . . . . .*/ 1582 + case 55: // charclass ::= OPENCLASS DASH classcontent CLOSECLASS 1583 + { 1584 + RegExp RESULT = null; 1585 + int listleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 1586 + int listright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 1587 + ArrayList list = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 1588 + int closeleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1589 + int closeright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1590 + Object close = (Object)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1591 + 1592 + #line 1236 "LexParse.cup" 1593 + 1594 + try { 1595 + list.Add(new Interval('-','-')); 1596 + charClasses.makeClass(list, Options.jlex && scanner.caseless); 1597 + } 1598 + catch (CharClassException) { 1599 + syntaxError(ErrorMessages.CHARSET_2_SMALL, closeleft, closeright); 1600 + } 1601 + RESULT = new RegExp1(sym.CCLASS,list); 1602 + 1603 + #line default 1604 + 1605 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(9/*charclass*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-3)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1606 + } 1607 + return CUPΔLexParseΔresult; 1608 + 1609 + /*. . . . . . . . . . . . . . . . . . . .*/ 1610 + case 54: // charclass ::= OPENCLASS HAT classcontent CLOSECLASS 1611 + { 1612 + RegExp RESULT = null; 1613 + int listleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 1614 + int listright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 1615 + ArrayList list = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 1616 + int closeleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1617 + int closeright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1618 + Object close = (Object)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1619 + 1620 + #line 1226 "LexParse.cup" 1621 + 1622 + try { 1623 + charClasses.makeClassNot(list, Options.jlex && scanner.caseless); 1624 + } 1625 + catch (CharClassException) { 1626 + syntaxError(ErrorMessages.CHARSET_2_SMALL, closeleft, closeright); 1627 + } 1628 + RESULT = new RegExp1(sym.CCLASSNOT,list); 1629 + 1630 + #line default 1631 + 1632 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(9/*charclass*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-3)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1633 + } 1634 + return CUPΔLexParseΔresult; 1635 + 1636 + /*. . . . . . . . . . . . . . . . . . . .*/ 1637 + case 53: // charclass ::= OPENCLASS HAT CLOSECLASS 1638 + { 1639 + RegExp RESULT = null; 1640 + int closeleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1641 + int closeright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1642 + Object close = (Object)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1643 + 1644 + #line 1214 "LexParse.cup" 1645 + 1646 + ArrayList list = new PrettyArrayList(); 1647 + list.Add(new Interval((char)0,CharClasses.maxChar)); 1648 + try { 1649 + charClasses.makeClass(list, false); 1650 + } 1651 + catch (CharClassException) { 1652 + syntaxError(ErrorMessages.CHARSET_2_SMALL, closeleft, closeright); 1653 + } 1654 + RESULT = new RegExp1(sym.CCLASS,list); 1655 + 1656 + #line default 1657 + 1658 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(9/*charclass*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1659 + } 1660 + return CUPΔLexParseΔresult; 1661 + 1662 + /*. . . . . . . . . . . . . . . . . . . .*/ 1663 + case 52: // charclass ::= OPENCLASS classcontent CLOSECLASS 1664 + { 1665 + RegExp RESULT = null; 1666 + int listleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 1667 + int listright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 1668 + ArrayList list = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 1669 + int closeleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1670 + int closeright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1671 + Object close = (Object)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1672 + 1673 + #line 1204 "LexParse.cup" 1674 + 1675 + try { 1676 + charClasses.makeClass(list, Options.jlex && scanner.caseless); 1677 + } 1678 + catch (CharClassException) { 1679 + syntaxError(ErrorMessages.CHARSET_2_SMALL, closeleft, closeright); 1680 + } 1681 + RESULT = new RegExp1(sym.CCLASS,list); 1682 + 1683 + #line default 1684 + 1685 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(9/*charclass*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1686 + } 1687 + return CUPΔLexParseΔresult; 1688 + 1689 + /*. . . . . . . . . . . . . . . . . . . .*/ 1690 + case 51: // charclass ::= OPENCLASS CLOSECLASS 1691 + { 1692 + RegExp RESULT = null; 1693 + 1694 + #line 1200 "LexParse.cup" 1695 + 1696 + RESULT = new RegExp1(sym.CCLASS,null); 1697 + 1698 + #line default 1699 + 1700 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(9/*charclass*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1701 + } 1702 + return CUPΔLexParseΔresult; 1703 + 1704 + /*. . . . . . . . . . . . . . . . . . . .*/ 1705 + case 50: // regexp ::= CHAR 1706 + { 1707 + RegExp RESULT = null; 1708 + int cleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1709 + int cright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1710 + char c = (char)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1711 + 1712 + #line 1182 "LexParse.cup" 1713 + 1714 + try { 1715 + if ( scanner.caseless ) { 1716 + charClasses.makeClass(c, true); 1717 + RESULT = new RegExp1(sym.CHAR_I, c); 1718 + } 1719 + else { 1720 + charClasses.makeClass(c, false); 1721 + RESULT = new RegExp1(sym.CHAR, c); 1722 + } 1723 + } 1724 + catch (CharClassException) { 1725 + syntaxError(ErrorMessages.CS2SMALL_CHAR, cleft, cright); 1726 + } 1727 + 1728 + #line default 1729 + 1730 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(8/*regexp*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1731 + } 1732 + return CUPΔLexParseΔresult; 1733 + 1734 + /*. . . . . . . . . . . . . . . . . . . .*/ 1735 + case 49: // regexp ::= POINT 1736 + { 1737 + RegExp RESULT = null; 1738 + 1739 + #line 1174 "LexParse.cup" 1740 + 1741 + ArrayList any = new PrettyArrayList(); 1742 + any.Add(new Interval('\n','\n')); 1743 + // assumption: there is no upper case for \n 1744 + charClasses.makeClass('\n', false); 1745 + RESULT = new RegExp1(sym.CCLASSNOT, any); 1746 + 1747 + #line default 1748 + 1749 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(8/*regexp*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1750 + } 1751 + return CUPΔLexParseΔresult; 1752 + 1753 + /*. . . . . . . . . . . . . . . . . . . .*/ 1754 + case 48: // regexp ::= STRING 1755 + { 1756 + RegExp RESULT = null; 1757 + int strleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1758 + int strright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1759 + String str = (String)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1760 + 1761 + #line 1157 "LexParse.cup" 1762 + 1763 + try { 1764 + if ( scanner.caseless ) { 1765 + charClasses.makeClass(str, true); 1766 + RESULT = new RegExp1(sym.STRING_I, str); 1767 + } 1768 + else { 1769 + charClasses.makeClass(str, false); 1770 + RESULT = new RegExp1(sym.STRING, str); 1771 + } 1772 + } 1773 + catch (CharClassException) { 1774 + syntaxError(ErrorMessages.CS2SMALL_STRING, strleft, strright); 1775 + } 1776 + 1777 + 1778 + #line default 1779 + 1780 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(8/*regexp*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1781 + } 1782 + return CUPΔLexParseΔresult; 1783 + 1784 + /*. . . . . . . . . . . . . . . . . . . .*/ 1785 + case 47: // regexp ::= preclass 1786 + { 1787 + RegExp RESULT = null; 1788 + int listleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1789 + int listright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1790 + ArrayList list = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1791 + 1792 + #line 1146 "LexParse.cup" 1793 + 1794 + try { 1795 + // assumption [correct?]: preclasses are already closed under case 1796 + charClasses.makeClass(list, false); 1797 + } 1798 + catch (CharClassException) { 1799 + syntaxError(ErrorMessages.CHARSET_2_SMALL, listleft); 1800 + } 1801 + RESULT = new RegExp1(sym.CCLASS, list); 1802 + 1803 + #line default 1804 + 1805 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(8/*regexp*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1806 + } 1807 + return CUPΔLexParseΔresult; 1808 + 1809 + /*. . . . . . . . . . . . . . . . . . . .*/ 1810 + case 46: // regexp ::= charclass 1811 + { 1812 + RegExp RESULT = null; 1813 + int cleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1814 + int cright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1815 + RegExp c = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1816 + 1817 + #line 1144 "LexParse.cup" 1818 + RESULT = c; 1819 + #line default 1820 + 1821 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(8/*regexp*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1822 + } 1823 + return CUPΔLexParseΔresult; 1824 + 1825 + /*. . . . . . . . . . . . . . . . . . . .*/ 1826 + case 45: // regexp ::= MACROUSE 1827 + { 1828 + RegExp RESULT = null; 1829 + int identleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1830 + int identright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1831 + String ident = (String)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1832 + 1833 + #line 1135 "LexParse.cup" 1834 + 1835 + if ( !scanner.macroDefinition ) { 1836 + if ( ! macros.markUsed(ident) ) 1837 + throw new ScannerException(scanner.file, ErrorMessages.MACRO_UNDECL, 1838 + identleft, identright); 1839 + } 1840 + RESULT = new RegExp1(sym.MACROUSE, ident); 1841 + 1842 + #line default 1843 + 1844 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(8/*regexp*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1845 + } 1846 + return CUPΔLexParseΔresult; 1847 + 1848 + /*. . . . . . . . . . . . . . . . . . . .*/ 1849 + case 44: // regexp ::= OPENBRACKET series CLOSEBRACKET 1850 + { 1851 + RegExp RESULT = null; 1852 + int rleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 1853 + int rright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 1854 + RegExp r = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 1855 + 1856 + #line 1133 "LexParse.cup" 1857 + RESULT = r; 1858 + #line default 1859 + 1860 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(8/*regexp*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1861 + } 1862 + return CUPΔLexParseΔresult; 1863 + 1864 + /*. . . . . . . . . . . . . . . . . . . .*/ 1865 + case 43: // regexp ::= regexp REPEAT REPEAT RBRACE 1866 + { 1867 + RegExp RESULT = null; 1868 + int rleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-3)).left; 1869 + int rright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-3)).right; 1870 + RegExp r = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-3)).value; 1871 + int n1left = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).left; 1872 + int n1right = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).right; 1873 + int n1 = (int)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).value; 1874 + int n2left = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 1875 + int n2right = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 1876 + int n2 = (int)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 1877 + 1878 + #line 1131 "LexParse.cup" 1879 + RESULT = makeRepeat(r, n1, n2, n1left, n2right); 1880 + #line default 1881 + 1882 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(8/*regexp*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-3)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1883 + } 1884 + return CUPΔLexParseΔresult; 1885 + 1886 + /*. . . . . . . . . . . . . . . . . . . .*/ 1887 + case 42: // regexp ::= regexp REPEAT RBRACE 1888 + { 1889 + RegExp RESULT = null; 1890 + int rleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).left; 1891 + int rright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).right; 1892 + RegExp r = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).value; 1893 + int nleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 1894 + int nright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 1895 + int n = (int)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 1896 + int bleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1897 + int bright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1898 + Object b = (Object)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1899 + 1900 + #line 1129 "LexParse.cup" 1901 + RESULT = makeRepeat(r, n, n, bleft, bright); 1902 + #line default 1903 + 1904 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(8/*regexp*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1905 + } 1906 + return CUPΔLexParseΔresult; 1907 + 1908 + /*. . . . . . . . . . . . . . . . . . . .*/ 1909 + case 41: // regexp ::= regexp QUESTION 1910 + { 1911 + RegExp RESULT = null; 1912 + int rleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 1913 + int rright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 1914 + RegExp r = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 1915 + 1916 + #line 1127 "LexParse.cup" 1917 + RESULT = new RegExp1(sym.QUESTION, r); 1918 + #line default 1919 + 1920 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(8/*regexp*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1921 + } 1922 + return CUPΔLexParseΔresult; 1923 + 1924 + /*. . . . . . . . . . . . . . . . . . . .*/ 1925 + case 40: // regexp ::= regexp PLUS 1926 + { 1927 + RegExp RESULT = null; 1928 + int rleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 1929 + int rright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 1930 + RegExp r = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 1931 + 1932 + #line 1125 "LexParse.cup" 1933 + RESULT = new RegExp1(sym.PLUS, r); 1934 + #line default 1935 + 1936 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(8/*regexp*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1937 + } 1938 + return CUPΔLexParseΔresult; 1939 + 1940 + /*. . . . . . . . . . . . . . . . . . . .*/ 1941 + case 39: // regexp ::= regexp STAR 1942 + { 1943 + RegExp RESULT = null; 1944 + int rleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 1945 + int rright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 1946 + RegExp r = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 1947 + 1948 + #line 1123 "LexParse.cup" 1949 + RESULT = new RegExp1(sym.STAR, r); 1950 + #line default 1951 + 1952 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(8/*regexp*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1953 + } 1954 + return CUPΔLexParseΔresult; 1955 + 1956 + /*. . . . . . . . . . . . . . . . . . . .*/ 1957 + case 38: // nregexp ::= TILDE nregexp 1958 + { 1959 + RegExp RESULT = null; 1960 + int rleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1961 + int rright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1962 + RegExp r = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1963 + 1964 + #line 1119 "LexParse.cup" 1965 + RESULT = new RegExp1(sym.TILDE, r); 1966 + #line default 1967 + 1968 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(7/*nregexp*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1969 + } 1970 + return CUPΔLexParseΔresult; 1971 + 1972 + /*. . . . . . . . . . . . . . . . . . . .*/ 1973 + case 37: // nregexp ::= BANG nregexp 1974 + { 1975 + RegExp RESULT = null; 1976 + int rleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1977 + int rright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1978 + RegExp r = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1979 + 1980 + #line 1117 "LexParse.cup" 1981 + RESULT = new RegExp1(sym.BANG, r); 1982 + #line default 1983 + 1984 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(7/*nregexp*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 1985 + } 1986 + return CUPΔLexParseΔresult; 1987 + 1988 + /*. . . . . . . . . . . . . . . . . . . .*/ 1989 + case 36: // nregexp ::= regexp 1990 + { 1991 + RegExp RESULT = null; 1992 + int rleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 1993 + int rright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 1994 + RegExp r = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 1995 + 1996 + #line 1115 "LexParse.cup" 1997 + RESULT = r; 1998 + #line default 1999 + 2000 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(7/*nregexp*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2001 + } 2002 + return CUPΔLexParseΔresult; 2003 + 2004 + /*. . . . . . . . . . . . . . . . . . . .*/ 2005 + case 35: // concs ::= nregexp 2006 + { 2007 + RegExp RESULT = null; 2008 + int rleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 2009 + int rright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 2010 + RegExp r = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 2011 + 2012 + #line 1111 "LexParse.cup" 2013 + RESULT = r; 2014 + #line default 2015 + 2016 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(6/*concs*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2017 + } 2018 + return CUPΔLexParseΔresult; 2019 + 2020 + /*. . . . . . . . . . . . . . . . . . . .*/ 2021 + case 34: // concs ::= concs nregexp 2022 + { 2023 + RegExp RESULT = null; 2024 + int r1left = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 2025 + int r1right = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 2026 + RegExp r1 = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 2027 + int r2left = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 2028 + int r2right = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 2029 + RegExp r2 = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 2030 + 2031 + #line 1109 "LexParse.cup" 2032 + RESULT = new RegExp2(sym.CONCAT, r1, r2); 2033 + #line default 2034 + 2035 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(6/*concs*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2036 + } 2037 + return CUPΔLexParseΔresult; 2038 + 2039 + /*. . . . . . . . . . . . . . . . . . . .*/ 2040 + case 33: // series ::= BAR 2041 + { 2042 + RegExp RESULT = null; 2043 + int bleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 2044 + int bright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 2045 + Object b = (Object)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 2046 + 2047 + #line 1105 "LexParse.cup" 2048 + syntaxError(ErrorMessages.REGEXP_EXPECTED, bleft, bright); 2049 + #line default 2050 + 2051 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(5/*series*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2052 + } 2053 + return CUPΔLexParseΔresult; 2054 + 2055 + /*. . . . . . . . . . . . . . . . . . . .*/ 2056 + case 32: // series ::= concs 2057 + { 2058 + RegExp RESULT = null; 2059 + int rleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 2060 + int rright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 2061 + RegExp r = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 2062 + 2063 + #line 1103 "LexParse.cup" 2064 + RESULT = r; 2065 + #line default 2066 + 2067 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(5/*series*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2068 + } 2069 + return CUPΔLexParseΔresult; 2070 + 2071 + /*. . . . . . . . . . . . . . . . . . . .*/ 2072 + case 31: // series ::= series BAR concs 2073 + { 2074 + RegExp RESULT = null; 2075 + int r1left = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).left; 2076 + int r1right = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).right; 2077 + RegExp r1 = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).value; 2078 + int r2left = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 2079 + int r2right = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 2080 + RegExp r2 = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 2081 + 2082 + #line 1101 "LexParse.cup" 2083 + RESULT = new RegExp2(sym.BAR, r1, r2); 2084 + #line default 2085 + 2086 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(5/*series*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2087 + } 2088 + return CUPΔLexParseΔresult; 2089 + 2090 + /*. . . . . . . . . . . . . . . . . . . .*/ 2091 + case 30: // hatOPT ::= 2092 + { 2093 + Boolean RESULT = null; 2094 + 2095 + #line 1097 "LexParse.cup" 2096 + RESULT = new Boolean(false); 2097 + #line default 2098 + 2099 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(17/*hatOPT*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2100 + } 2101 + return CUPΔLexParseΔresult; 2102 + 2103 + /*. . . . . . . . . . . . . . . . . . . .*/ 2104 + case 29: // hatOPT ::= HAT 2105 + { 2106 + Boolean RESULT = null; 2107 + 2108 + #line 1093 "LexParse.cup" 2109 + // assumption: there is no upper case for \n 2110 + charClasses.makeClass('\n', false); 2111 + RESULT = new Boolean(true); 2112 + #line default 2113 + 2114 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(17/*hatOPT*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2115 + } 2116 + return CUPΔLexParseΔresult; 2117 + 2118 + /*. . . . . . . . . . . . . . . . . . . .*/ 2119 + case 28: // states ::= IDENT COMMA 2120 + { 2121 + ArrayList RESULT = null; 2122 + int cleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 2123 + int cright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 2124 + Object c = (Object)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 2125 + 2126 + #line 1089 "LexParse.cup" 2127 + syntaxError(ErrorMessages.REGEXP_EXPECTED, cleft, cright+1); 2128 + #line default 2129 + 2130 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(12/*states*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2131 + } 2132 + return CUPΔLexParseΔresult; 2133 + 2134 + /*. . . . . . . . . . . . . . . . . . . .*/ 2135 + case 27: // states ::= IDENT 2136 + { 2137 + ArrayList RESULT = null; 2138 + int idleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 2139 + int idright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 2140 + String id = (String)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 2141 + 2142 + #line 1077 "LexParse.cup" 2143 + 2144 + ArrayList list = new PrettyArrayList(); 2145 + stateNumber = scanner.states.getNumber( id ); 2146 + if ( stateNumber != null ) 2147 + list.Add( stateNumber.intValue() ); 2148 + else { 2149 + throw new ScannerException(scanner.file, ErrorMessages.LEXSTATE_UNDECL, 2150 + idleft, idright); 2151 + } 2152 + RESULT = list; 2153 + 2154 + #line default 2155 + 2156 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(12/*states*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2157 + } 2158 + return CUPΔLexParseΔresult; 2159 + 2160 + /*. . . . . . . . . . . . . . . . . . . .*/ 2161 + case 26: // states ::= IDENT COMMA states 2162 + { 2163 + ArrayList RESULT = null; 2164 + int idleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).left; 2165 + int idright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).right; 2166 + String id = (String)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).value; 2167 + int listleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 2168 + int listright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 2169 + ArrayList list = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 2170 + 2171 + #line 1066 "LexParse.cup" 2172 + 2173 + stateNumber = scanner.states.getNumber( id ); 2174 + if ( stateNumber != null ) 2175 + list.Add( stateNumber.intValue() ); 2176 + else { 2177 + throw new ScannerException(scanner.file, ErrorMessages.LEXSTATE_UNDECL, 2178 + idleft, idright); 2179 + } 2180 + RESULT = list; 2181 + 2182 + #line default 2183 + 2184 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(12/*states*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2185 + } 2186 + return CUPΔLexParseΔresult; 2187 + 2188 + /*. . . . . . . . . . . . . . . . . . . .*/ 2189 + case 25: // statesOPT ::= 2190 + { 2191 + ArrayList RESULT = null; 2192 + 2193 + #line 1062 "LexParse.cup" 2194 + RESULT = new PrettyArrayList(); 2195 + #line default 2196 + 2197 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(13/*statesOPT*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2198 + } 2199 + return CUPΔLexParseΔresult; 2200 + 2201 + /*. . . . . . . . . . . . . . . . . . . .*/ 2202 + case 24: // statesOPT ::= LESSTHAN states MORETHAN 2203 + { 2204 + ArrayList RESULT = null; 2205 + int listleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 2206 + int listright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 2207 + ArrayList list = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 2208 + 2209 + #line 1060 "LexParse.cup" 2210 + RESULT = list; 2211 + #line default 2212 + 2213 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(13/*statesOPT*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2214 + } 2215 + return CUPΔLexParseΔresult; 2216 + 2217 + /*. . . . . . . . . . . . . . . . . . . .*/ 2218 + case 23: // actions ::= NOACTION 2219 + { 2220 + Action RESULT = null; 2221 + 2222 + #line 1055 "LexParse.cup" 2223 + RESULT = null; 2224 + #line default 2225 + 2226 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(18/*actions*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2227 + } 2228 + return CUPΔLexParseΔresult; 2229 + 2230 + /*. . . . . . . . . . . . . . . . . . . .*/ 2231 + case 22: // actions ::= REGEXPEND ACTION 2232 + { 2233 + Action RESULT = null; 2234 + int aleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 2235 + int aright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 2236 + Action a = (Action)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 2237 + 2238 + #line 1053 "LexParse.cup" 2239 + RESULT = a; 2240 + #line default 2241 + 2242 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(18/*actions*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2243 + } 2244 + return CUPΔLexParseΔresult; 2245 + 2246 + /*. . . . . . . . . . . . . . . . . . . .*/ 2247 + case 21: // lookaheadOPT ::= LOOKAHEAD series DOLLAR 2248 + { 2249 + RegExp RESULT = null; 2250 + int sleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 2251 + int sright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 2252 + RegExp s = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 2253 + 2254 + #line 1049 "LexParse.cup" 2255 + RESULT = new RegExp2(sym.CONCAT, s, makeNL()); 2256 + #line default 2257 + 2258 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(10/*lookaheadOPT*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2259 + } 2260 + return CUPΔLexParseΔresult; 2261 + 2262 + /*. . . . . . . . . . . . . . . . . . . .*/ 2263 + case 20: // lookaheadOPT ::= 2264 + { 2265 + RegExp RESULT = null; 2266 + 2267 + #line 1047 "LexParse.cup" 2268 + RESULT = null; 2269 + #line default 2270 + 2271 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(10/*lookaheadOPT*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2272 + } 2273 + return CUPΔLexParseΔresult; 2274 + 2275 + /*. . . . . . . . . . . . . . . . . . . .*/ 2276 + case 19: // lookaheadOPT ::= LOOKAHEAD series 2277 + { 2278 + RegExp RESULT = null; 2279 + int rleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 2280 + int rright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 2281 + RegExp r = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 2282 + 2283 + #line 1045 "LexParse.cup" 2284 + RESULT = r; 2285 + #line default 2286 + 2287 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(10/*lookaheadOPT*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2288 + } 2289 + return CUPΔLexParseΔresult; 2290 + 2291 + /*. . . . . . . . . . . . . . . . . . . .*/ 2292 + case 18: // lookaheadOPT ::= DOLLAR 2293 + { 2294 + RegExp RESULT = null; 2295 + 2296 + #line 1043 "LexParse.cup" 2297 + RESULT = makeNL(); 2298 + #line default 2299 + 2300 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(10/*lookaheadOPT*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2301 + } 2302 + return CUPΔLexParseΔresult; 2303 + 2304 + /*. . . . . . . . . . . . . . . . . . . .*/ 2305 + case 17: // rule ::= error 2306 + { 2307 + Integer RESULT = null; 2308 + 2309 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(3/*rule*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2310 + } 2311 + return CUPΔLexParseΔresult; 2312 + 2313 + /*. . . . . . . . . . . . . . . . . . . .*/ 2314 + case 16: // rule ::= statesOPT EOFRULE ACTION 2315 + { 2316 + Integer RESULT = null; 2317 + int sleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).left; 2318 + int sright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).right; 2319 + ArrayList s = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).value; 2320 + int aleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 2321 + int aright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 2322 + Action a = (Action)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 2323 + 2324 + #line 1038 "LexParse.cup" 2325 + RESULT = new Integer(regExps.insert(s, a)); 2326 + #line default 2327 + 2328 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(3/*rule*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2329 + } 2330 + return CUPΔLexParseΔresult; 2331 + 2332 + /*. . . . . . . . . . . . . . . . . . . .*/ 2333 + case 15: // rule ::= statesOPT hatOPT series lookaheadOPT actions 2334 + { 2335 + Integer RESULT = null; 2336 + int sleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-4)).left; 2337 + int sright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-4)).right; 2338 + ArrayList s = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-4)).value; 2339 + int bolleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-3)).left; 2340 + int bolright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-3)).right; 2341 + Boolean bol = (Boolean)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-3)).value; 2342 + int rleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).left; 2343 + int rright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).right; 2344 + RegExp r = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-2)).value; 2345 + int lleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 2346 + int lright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 2347 + RegExp l = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 2348 + int aleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 2349 + int aright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 2350 + Action a = (Action)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 2351 + 2352 + #line 1036 "LexParse.cup" 2353 + RESULT = new Integer(regExps.insert(rleft, s, r, a, bol, l)); 2354 + #line default 2355 + 2356 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(3/*rule*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-4)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2357 + } 2358 + return CUPΔLexParseΔresult; 2359 + 2360 + /*. . . . . . . . . . . . . . . . . . . .*/ 2361 + case 14: // rules ::= rule 2362 + { 2363 + ArrayList RESULT = null; 2364 + int rleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 2365 + int rright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 2366 + Integer r = (Integer)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 2367 + 2368 + #line 1032 "LexParse.cup" 2369 + RESULT = new PrettyArrayList(); RESULT.Add(r.intValue()); 2370 + #line default 2371 + 2372 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(16/*rules*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2373 + } 2374 + return CUPΔLexParseΔresult; 2375 + 2376 + /*. . . . . . . . . . . . . . . . . . . .*/ 2377 + case 13: // rules ::= LESSTHAN states MORETHAN LBRACE rules RBRACE 2378 + { 2379 + ArrayList RESULT = null; 2380 + int statesleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-4)).left; 2381 + int statesright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-4)).right; 2382 + ArrayList states = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-4)).value; 2383 + int rlistleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 2384 + int rlistright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 2385 + ArrayList rlist = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 2386 + 2387 + #line 1023 "LexParse.cup" 2388 + 2389 + IEnumerator rs = rlist.GetEnumerator(); 2390 + while ( rs.MoveNext() ) { 2391 + int elem = (int) rs.Current; 2392 + regExps.addStates( elem, states ); 2393 + } 2394 + RESULT = rlist; 2395 + 2396 + #line default 2397 + 2398 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(16/*rules*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-5)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2399 + } 2400 + return CUPΔLexParseΔresult; 2401 + 2402 + /*. . . . . . . . . . . . . . . . . . . .*/ 2403 + case 12: // rules ::= rules LESSTHAN states MORETHAN LBRACE rules RBRACE 2404 + { 2405 + ArrayList RESULT = null; 2406 + int rlist1left = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-6)).left; 2407 + int rlist1right = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-6)).right; 2408 + ArrayList rlist1 = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-6)).value; 2409 + int statesleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-4)).left; 2410 + int statesright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-4)).right; 2411 + ArrayList states = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-4)).value; 2412 + int rlist2left = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 2413 + int rlist2right = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 2414 + ArrayList rlist2 = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 2415 + 2416 + #line 1013 "LexParse.cup" 2417 + 2418 + IEnumerator rs = rlist2.GetEnumerator(); 2419 + while ( rs.MoveNext() ) { 2420 + int elem = (int) rs.Current; 2421 + regExps.addStates( elem, states ); 2422 + rlist1.Add( elem ); 2423 + } 2424 + RESULT = rlist1; 2425 + 2426 + #line default 2427 + 2428 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(16/*rules*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-6)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2429 + } 2430 + return CUPΔLexParseΔresult; 2431 + 2432 + /*. . . . . . . . . . . . . . . . . . . .*/ 2433 + case 11: // rules ::= rules rule 2434 + { 2435 + ArrayList RESULT = null; 2436 + int rlistleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 2437 + int rlistright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 2438 + ArrayList rlist = (ArrayList)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 2439 + int rleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 2440 + int rright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 2441 + Integer r = (Integer)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 2442 + 2443 + #line 1011 "LexParse.cup" 2444 + rlist.Add(r.intValue()); RESULT = rlist; 2445 + #line default 2446 + 2447 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(16/*rules*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2448 + } 2449 + return CUPΔLexParseΔresult; 2450 + 2451 + /*. . . . . . . . . . . . . . . . . . . .*/ 2452 + case 10: // macro ::= IDENT EQUALS 2453 + { 2454 + Object RESULT = null; 2455 + int eleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left; 2456 + int eright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right; 2457 + Object e = (Object)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).value; 2458 + 2459 + #line 1006 "LexParse.cup" 2460 + syntaxError(ErrorMessages.REGEXP_EXPECTED, eleft, eright); 2461 + #line default 2462 + 2463 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(2/*macro*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2464 + } 2465 + return CUPΔLexParseΔresult; 2466 + 2467 + /*. . . . . . . . . . . . . . . . . . . .*/ 2468 + case 9: // macro ::= IDENT EQUALS series REGEXPEND 2469 + { 2470 + Object RESULT = null; 2471 + int nameleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-3)).left; 2472 + int nameright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-3)).right; 2473 + String name = (String)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-3)).value; 2474 + int definitionleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 2475 + int definitionright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 2476 + RegExp definition = (RegExp)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 2477 + 2478 + #line 1004 "LexParse.cup" 2479 + macros.insert(name, definition); 2480 + #line default 2481 + 2482 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(2/*macro*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-3)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2483 + } 2484 + return CUPΔLexParseΔresult; 2485 + 2486 + /*. . . . . . . . . . . . . . . . . . . .*/ 2487 + case 8: // macro ::= UNICODE 2488 + { 2489 + Object RESULT = null; 2490 + 2491 + #line 1002 "LexParse.cup" 2492 + charClasses.setMaxCharCode(0xFFFF); 2493 + #line default 2494 + 2495 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(2/*macro*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2496 + } 2497 + return CUPΔLexParseΔresult; 2498 + 2499 + /*. . . . . . . . . . . . . . . . . . . .*/ 2500 + case 7: // macro ::= FULL 2501 + { 2502 + Object RESULT = null; 2503 + 2504 + #line 1000 "LexParse.cup" 2505 + charClasses.setMaxCharCode(255); 2506 + #line default 2507 + 2508 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(2/*macro*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2509 + } 2510 + return CUPΔLexParseΔresult; 2511 + 2512 + /*. . . . . . . . . . . . . . . . . . . .*/ 2513 + case 6: // macros ::= error 2514 + { 2515 + Object RESULT = null; 2516 + 2517 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(1/*macros*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2518 + } 2519 + return CUPΔLexParseΔresult; 2520 + 2521 + /*. . . . . . . . . . . . . . . . . . . .*/ 2522 + case 5: // macros ::= macros macro 2523 + { 2524 + Object RESULT = null; 2525 + 2526 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(1/*macros*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2527 + } 2528 + return CUPΔLexParseΔresult; 2529 + 2530 + /*. . . . . . . . . . . . . . . . . . . .*/ 2531 + case 4: // macros ::= 2532 + { 2533 + Object RESULT = null; 2534 + 2535 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(1/*macros*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2536 + } 2537 + return CUPΔLexParseΔresult; 2538 + 2539 + /*. . . . . . . . . . . . . . . . . . . .*/ 2540 + case 3: // specification ::= 2541 + { 2542 + NFA RESULT = null; 2543 + 2544 + #line 990 "LexParse.cup" 2545 + 2546 + fatalError(ErrorMessages.NO_LEX_SPEC); 2547 + 2548 + #line default 2549 + 2550 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(4/*specification*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2551 + } 2552 + return CUPΔLexParseΔresult; 2553 + 2554 + /*. . . . . . . . . . . . . . . . . . . .*/ 2555 + case 2: // specification ::= USERCODE macros DELIMITER rules DELIMITER EPILOGUE 2556 + { 2557 + NFA RESULT = null; 2558 + 2559 + #line 946 "LexParse.cup" 2560 + 2561 + scanner.t.stop(); 2562 + 2563 + Out.checkErrors(); 2564 + 2565 + Out.time(ErrorMessages.PARSING_TOOK, t); 2566 + 2567 + macros.expand(); 2568 + IEnumerator unused = macros.unused(); 2569 + while ( unused.MoveNext() ) { 2570 + Out.warning("Macro \""+unused.Current+"\" has been declared but never used."); 2571 + } 2572 + 2573 + SemCheck.check(regExps, macros, charClasses.getMaxCharCode(), scanner.file); 2574 + 2575 + regExps.checkActions(); 2576 + 2577 + if (Options.dump) charClasses.dump(); 2578 + 2579 + Out.print("Constructing NFA : "); 2580 + 2581 + t.start(); 2582 + int num = regExps.getNum(); 2583 + 2584 + RESULT = new NFA(charClasses.getNumClasses(), 2585 + scanner, regExps, macros, charClasses); 2586 + 2587 + eofActions.setNumLexStates(scanner.states.number()); 2588 + 2589 + for (int i = 0; i < num; i++) { 2590 + if (regExps.isEOF(i)) 2591 + eofActions.add( regExps.getStates(i), regExps.getAction(i) ); 2592 + else 2593 + RESULT.addRegExp(i); 2594 + } 2595 + 2596 + if (scanner.standalone) RESULT.addStandaloneRule(); 2597 + t.stop(); 2598 + 2599 + Out.time(""); 2600 + Out.time(ErrorMessages.NFA_TOOK, t); 2601 + 2602 + 2603 + #line default 2604 + 2605 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(4/*specification*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-5)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2606 + } 2607 + return CUPΔLexParseΔresult; 2608 + 2609 + /*. . . . . . . . . . . . . . . . . . . .*/ 2610 + case 1: // specification ::= USERCODE macros DELIMITER rules 2611 + { 2612 + NFA RESULT = null; 2613 + 2614 + #line 896 "LexParse.cup" 2615 + 2616 + scanner.t.stop(); 2617 + 2618 + Out.checkErrors(); 2619 + 2620 + Out.time(ErrorMessages.PARSING_TOOK, t); 2621 + 2622 + macros.expand(); 2623 + IEnumerator unused = macros.unused(); 2624 + while ( unused.MoveNext() ) { 2625 + Out.warning("Macro \""+unused.Current+"\" has been declared but never used."); 2626 + } 2627 + 2628 + SemCheck.check(regExps, macros, charClasses.getMaxCharCode(), scanner.file); 2629 + 2630 + regExps.checkActions(); 2631 + 2632 + if (Options.dump) charClasses.dump(); 2633 + 2634 + Out.print("Constructing NFA : "); 2635 + 2636 + t.start(); 2637 + int num = regExps.getNum(); 2638 + 2639 + RESULT = new NFA(charClasses.getNumClasses(), 2640 + scanner, regExps, macros, charClasses); 2641 + 2642 + eofActions.setNumLexStates(scanner.states.number()); 2643 + 2644 + for (int i = 0; i < num; i++) { 2645 + if (regExps.isEOF(i)) 2646 + eofActions.add( regExps.getStates(i), regExps.getAction(i) ); 2647 + else 2648 + RESULT.addRegExp(i); 2649 + } 2650 + 2651 + if (scanner.standalone) RESULT.addStandaloneRule(); 2652 + t.stop(); 2653 + 2654 + Out.time(""); 2655 + Out.time(ErrorMessages.NFA_TOOK, t); 2656 + 2657 + 2658 + #line default 2659 + 2660 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(4/*specification*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-3)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2661 + } 2662 + return CUPΔLexParseΔresult; 2663 + 2664 + /*. . . . . . . . . . . . . . . . . . . .*/ 2665 + case 0: // $START ::= specification EOF 2666 + { 2667 + Object RESULT = null; 2668 + int start_valleft = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left; 2669 + int start_valright = ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).right; 2670 + NFA start_val = (NFA)((java_cup.runtime.Symbol) CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).value; 2671 + RESULT = start_val; 2672 + CUPΔLexParseΔresult = new java_cup.runtime.Symbol(0/*$START*/, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-1)).left, ((java_cup.runtime.Symbol)CUPΔLexParseΔstack.elementAt(CUPΔLexParseΔtop-0)).right, RESULT); 2673 + } 2674 + /* ACCEPT */ 2675 + CUPΔLexParseΔparser.done_parsing(); 2676 + return CUPΔLexParseΔresult; 2677 + 2678 + /* . . . . . .*/ 2679 + default: 2680 + throw new Exception( 2681 + "Invalid action number found in internal parse table"); 2682 + 2683 + } 2684 + } 2685 + } 2686 + 2687 + }
+3728
CSFlex/Core/LexScan.cs
··· 1 + /* The following code was generated by CSFlex 1.4 on 01/10/2004 */ 2 + 3 + #line 1 "LexScan.flex" 4 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 5 + * C# Flex 1.4 * 6 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 7 + * Derived from: * 8 + * * 9 + * JFlex 1.4 * 10 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 11 + * All rights reserved. * 12 + * * 13 + * This program is free software; you can redistribute it and/or modify * 14 + * it under the terms of the GNU General Public License. See the file * 15 + * COPYRIGHT for more information. * 16 + * * 17 + * This program is distributed in the hope that it will be useful, * 18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 20 + * GNU General Public License for more details. * 21 + * * 22 + * You should have received a copy of the GNU General Public License along * 23 + * with this program; if not, write to the Free Software Foundation, Inc., * 24 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 25 + * * 26 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 27 + 28 + using System; 29 + using System.Collections; 30 + using System.IO; 31 + using System.Text; 32 + 33 + using java_cup.runtime; 34 + 35 + namespace CSFlex 36 + { 37 + 38 + /** 39 + * The lexer of C# Flex. 40 + * 41 + * Generated by C# Flex, based on <a href="http://www.jflex.de/">JFlex</a>. 42 + * 43 + * @author Gerwin Klein 44 + * @author Jonathan Gilbert 45 + * @version CSFlex 1.4, $Revision: 2.6 $, $Date: 2004/04/12 10:07:47 $ 46 + */ 47 + 48 + #line default 49 + public sealed class LexScan: sym, java_cup.runtime.Scanner { 50 + 51 + /** This character denotes the end of file */ 52 + public const int YYEOF = -1; 53 + 54 + /** initial size of the lookahead buffer */ 55 + private const int ZZ_BUFFERSIZE = 16384; 56 + /** 57 + * This is used in 'if' statements to eliminate dead code 58 + * warnings for 'break;' after the end of a user action 59 + * block of code. The Java version does this by emitting 60 + * a second 'case' which is impossible to reach. Since this 61 + * is impossible for the compiler to deduce during semantic 62 + * analysis, the warning is stifled. However, C# does not 63 + * permit 'case' blocks to flow into each other, so the C# 64 + * output mode needs a different approach. In this case, 65 + * the entire user code is wrapped up in an 'if' statement 66 + * whose condition is always true. No warning is emitted 67 + * because the compiler doesn't strictly propagate the value 68 + * of 'static readonly' fields, and thus does not semantically 69 + * detect the fact that the 'if' will always be true. 70 + */ 71 + public static readonly bool ZZ_SPURIOUS_WARNINGS_SUCK = true; 72 + 73 + /** lexical states */ 74 + public const int JAVA_CODE = 12; 75 + public const int STATES = 14; 76 + public const int USEREPILOGUE = 26; 77 + public const int REGEXPSTART = 8; 78 + public const int MACROS = 6; 79 + public const int STATELIST = 4; 80 + public const int REGEXP = 10; 81 + public const int YYINITIAL = 0; 82 + public const int REPEATEXP = 22; 83 + public const int COPY = 20; 84 + public const int COMMENT = 2; 85 + public const int EATWSPNL = 24; 86 + public const int CHARCLASS = 18; 87 + public const int STRING_CONTENT = 16; 88 + 89 + /** 90 + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l 91 + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l 92 + * at the beginning of a line 93 + * l is of the form l = 2*k, k a non negative integer 94 + */ 95 + private static readonly int[] ZZ_LEXSTATE = new int[]{ 96 + 0, 0, 1, 1, 2, 2, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 97 + 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14 98 + }; 99 + static LexScan() 100 + { 101 + ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); 102 + ZZ_ACTION = zzUnpackAction(); 103 + ZZ_ROWMAP = zzUnpackRowMap(); 104 + ZZ_TRANS = zzUnpackTrans(); 105 + ZZ_ATTRIBUTE = zzUnpackAttribute(); 106 + } 107 + 108 + 109 + /** 110 + * Translates characters to character classes 111 + */ 112 + private static readonly ushort[] ZZ_CMAP_PACKED = new ushort[] { 113 + 8, 17, 1, 18, 1, 8, 1, 11, 2, 9, 1, 10, 14, 17, 4, 0, 1, 8, 1, 60, 114 + 1, 22, 1, 0, 1, 66, 1, 25, 1, 0, 1, 23, 1, 62, 1, 63, 1, 20, 1, 64, 115 + 1, 13, 1, 69, 1, 12, 1, 21, 1, 7, 1, 50, 2, 7, 2, 3, 1, 51, 1, 48, 116 + 1, 49, 1, 1, 1, 68, 1, 0, 1, 54, 1, 53, 1, 58, 1, 65, 1, 0, 4, 2, 117 + 1, 55, 1, 57, 8, 16, 1, 56, 11, 16, 1, 14, 1, 4, 1, 15, 1, 67, 1, 16, 118 + 1, 0, 1, 39, 1, 43, 1, 41, 1, 46, 1, 34, 1, 35, 1, 47, 1, 30, 1, 27, 119 + 1, 44, 1, 52, 1, 37, 1, 42, 1, 28, 1, 32, 1, 45, 1, 16, 1, 31, 1, 40, 120 + 1, 29, 1, 6, 1, 38, 1, 33, 1, 5, 1, 36, 1, 16, 1, 26, 1, 59, 1, 24, 121 + 1, 61, 6, 17, 1, 19, 26, 17, 2, 0, 4, 16, 4, 0, 1, 16, 7, 0, 2, 17, 122 + 1, 0, 1, 16, 3, 0, 1, 17, 1, 16, 5, 0, 23, 16, 1, 0, 31, 16, 1, 0, 123 + 0x0128, 16, 2, 0, 18, 16, 28, 0, 94, 16, 2, 0, 9, 16, 2, 0, 7, 16, 14, 0, 124 + 2, 16, 14, 0, 5, 16, 9, 0, 1, 16, 17, 0, 70, 17, 26, 0, 2, 17, 24, 0, 125 + 1, 16, 11, 0, 1, 16, 1, 0, 3, 16, 1, 0, 1, 16, 1, 0, 20, 16, 1, 0, 126 + 44, 16, 1, 0, 8, 16, 2, 0, 26, 16, 12, 0, 130, 16, 1, 0, 4, 17, 5, 0, 127 + 57, 16, 2, 0, 2, 16, 2, 0, 2, 16, 3, 0, 38, 16, 2, 0, 2, 16, 55, 0, 128 + 38, 16, 2, 0, 1, 16, 7, 0, 39, 16, 9, 0, 41, 17, 1, 0, 3, 17, 1, 0, 129 + 1, 17, 1, 0, 2, 17, 1, 0, 1, 17, 11, 0, 27, 16, 5, 0, 3, 16, 46, 0, 130 + 26, 16, 5, 0, 11, 16, 8, 17, 13, 0, 10, 17, 6, 0, 1, 17, 99, 16, 1, 0, 131 + 1, 16, 7, 17, 2, 0, 6, 17, 2, 16, 2, 17, 1, 0, 4, 17, 2, 0, 10, 17, 132 + 3, 16, 19, 0, 1, 16, 1, 0, 27, 16, 83, 0, 38, 16, 0x015b, 0, 3, 17, 1, 0, 133 + 53, 16, 2, 0, 1, 17, 1, 16, 16, 17, 2, 0, 1, 16, 4, 17, 3, 0, 10, 16, 134 + 2, 17, 2, 0, 10, 17, 17, 0, 3, 17, 1, 0, 8, 16, 2, 0, 2, 16, 2, 0, 135 + 22, 16, 1, 0, 7, 16, 1, 0, 1, 16, 3, 0, 4, 16, 2, 0, 1, 17, 1, 0, 136 + 7, 17, 2, 0, 2, 17, 2, 0, 3, 17, 9, 0, 1, 17, 4, 0, 2, 16, 1, 0, 137 + 3, 16, 2, 17, 2, 0, 10, 17, 4, 16, 4, 17, 1, 0, 1, 17, 8, 0, 1, 17, 138 + 2, 0, 6, 16, 4, 0, 2, 16, 2, 0, 22, 16, 1, 0, 7, 16, 1, 0, 2, 16, 139 + 1, 0, 2, 16, 1, 0, 2, 16, 2, 0, 1, 17, 1, 0, 5, 17, 4, 0, 2, 17, 140 + 2, 0, 3, 17, 11, 0, 4, 16, 1, 0, 1, 16, 7, 0, 12, 17, 3, 16, 12, 0, 141 + 3, 17, 1, 0, 7, 16, 1, 0, 1, 16, 1, 0, 3, 16, 1, 0, 22, 16, 1, 0, 142 + 7, 16, 1, 0, 2, 16, 1, 0, 5, 16, 2, 0, 1, 17, 1, 16, 8, 17, 1, 0, 143 + 3, 17, 1, 0, 3, 17, 2, 0, 1, 16, 15, 0, 1, 16, 5, 0, 10, 17, 17, 0, 144 + 3, 17, 1, 0, 8, 16, 2, 0, 2, 16, 2, 0, 22, 16, 1, 0, 7, 16, 1, 0, 145 + 2, 16, 2, 0, 4, 16, 2, 0, 1, 17, 1, 16, 6, 17, 3, 0, 7, 17, 8, 0, 146 + 2, 17, 4, 0, 2, 16, 1, 0, 3, 16, 4, 0, 10, 17, 18, 0, 2, 17, 1, 0, 147 + 6, 16, 3, 0, 3, 16, 1, 0, 4, 16, 3, 0, 2, 16, 1, 0, 1, 16, 1, 0, 148 + 2, 16, 3, 0, 2, 16, 3, 0, 3, 16, 3, 0, 8, 16, 1, 0, 3, 16, 4, 0, 149 + 71, 17, 8, 16, 1, 17, 3, 16, 1, 17, 23, 16, 1, 17, 10, 16, 1, 17, 5, 16, 150 + 11, 17, 1, 0, 3, 17, 1, 0, 4, 17, 7, 0, 2, 17, 9, 0, 2, 16, 4, 0, 151 + 10, 17, 18, 0, 2, 17, 1, 0, 8, 16, 1, 0, 3, 16, 1, 0, 23, 16, 1, 0, 152 + 10, 16, 1, 0, 5, 16, 4, 0, 7, 17, 1, 0, 3, 17, 1, 0, 4, 17, 7, 0, 153 + 2, 17, 7, 0, 1, 16, 1, 0, 2, 16, 4, 0, 10, 17, 18, 0, 2, 17, 1, 0, 154 + 8, 16, 1, 0, 3, 16, 1, 0, 23, 16, 1, 0, 16, 16, 4, 0, 6, 17, 2, 0, 155 + 3, 17, 1, 0, 4, 17, 9, 0, 1, 17, 8, 0, 2, 16, 4, 0, 10, 17, 21, 0, 156 + 18, 16, 3, 0, 24, 16, 1, 0, 9, 16, 1, 0, 1, 16, 2, 0, 7, 16, 58, 0, 157 + 48, 16, 1, 17, 2, 16, 7, 17, 4, 0, 8, 16, 8, 17, 1, 0, 10, 17, 39, 0, 158 + 2, 16, 1, 0, 1, 16, 2, 0, 2, 16, 1, 0, 1, 16, 2, 0, 1, 16, 6, 0, 159 + 4, 16, 1, 0, 7, 16, 1, 0, 3, 16, 1, 0, 1, 16, 1, 0, 1, 16, 2, 0, 160 + 2, 16, 1, 0, 4, 16, 1, 17, 2, 16, 6, 17, 1, 0, 2, 17, 1, 16, 2, 0, 161 + 5, 16, 1, 0, 1, 16, 1, 0, 6, 17, 2, 0, 10, 17, 2, 0, 2, 16, 34, 0, 162 + 1, 16, 23, 0, 2, 17, 6, 0, 10, 17, 11, 0, 1, 17, 1, 0, 1, 17, 1, 0, 163 + 1, 17, 4, 0, 2, 17, 8, 16, 1, 0, 34, 16, 6, 0, 23, 17, 4, 16, 4, 0, 164 + 6, 17, 1, 0, 1, 17, 1, 0, 21, 17, 3, 0, 7, 17, 1, 0, 1, 17, 70, 0, 165 + 34, 16, 1, 0, 5, 16, 1, 0, 2, 16, 37, 0, 6, 16, 74, 0, 38, 16, 10, 0, 166 + 39, 16, 9, 0, 90, 16, 5, 0, 68, 16, 5, 0, 82, 16, 6, 0, 7, 16, 1, 0, 167 + 63, 16, 1, 0, 1, 16, 1, 0, 4, 16, 2, 0, 7, 16, 1, 0, 1, 16, 1, 0, 168 + 4, 16, 2, 0, 39, 16, 1, 0, 1, 16, 1, 0, 4, 16, 2, 0, 31, 16, 1, 0, 169 + 1, 16, 1, 0, 4, 16, 2, 0, 7, 16, 1, 0, 1, 16, 1, 0, 4, 16, 2, 0, 170 + 7, 16, 1, 0, 7, 16, 1, 0, 23, 16, 1, 0, 31, 16, 1, 0, 1, 16, 1, 0, 171 + 4, 16, 2, 0, 7, 16, 1, 0, 39, 16, 1, 0, 19, 16, 69, 0, 85, 16, 12, 0, 172 + 0x026c, 16, 2, 0, 8, 16, 10, 0, 26, 16, 5, 0, 75, 16, 149, 0, 52, 16, 108, 0, 173 + 88, 16, 8, 0, 41, 16, 0x0557, 0, 156, 16, 4, 0, 90, 16, 6, 0, 22, 16, 2, 0, 174 + 6, 16, 2, 0, 38, 16, 2, 0, 6, 16, 2, 0, 8, 16, 1, 0, 1, 16, 1, 0, 175 + 1, 16, 1, 0, 1, 16, 1, 0, 31, 16, 2, 0, 53, 16, 1, 0, 7, 16, 1, 0, 176 + 1, 16, 3, 0, 3, 16, 1, 0, 7, 16, 3, 0, 4, 16, 2, 0, 6, 16, 4, 0, 177 + 13, 16, 5, 0, 3, 16, 1, 0, 7, 16, 15, 0, 4, 17, 24, 0, 2, 9, 5, 17, 178 + 16, 0, 2, 16, 41, 0, 7, 17, 3, 0, 6, 17, 5, 0, 1, 16, 10, 17, 22, 0, 179 + 12, 16, 36, 0, 13, 17, 4, 0, 1, 17, 32, 0, 1, 16, 4, 0, 1, 16, 2, 0, 180 + 10, 16, 1, 0, 1, 16, 3, 0, 5, 16, 6, 0, 1, 16, 1, 0, 1, 16, 1, 0, 181 + 1, 16, 1, 0, 4, 16, 1, 0, 3, 16, 1, 0, 7, 16, 37, 0, 36, 17, 0x02dd, 0, 182 + 60, 17, 78, 0, 1, 17, 0x028b, 0, 30, 17, 0x0871, 0, 2, 16, 1, 17, 25, 0, 15, 17, 183 + 1, 0, 5, 16, 11, 0, 84, 16, 4, 0, 2, 17, 2, 0, 2, 16, 2, 0, 90, 16, 184 + 1, 0, 3, 16, 6, 0, 40, 16, 4, 0, 94, 16, 17, 0, 24, 16, 200, 0, 10, 17, 185 + 0x0176, 0, 0x19b6, 16, 74, 0, 0x51a6, 16, 90, 0, 0x048d, 16, 0x0773, 0, 0x2ba4, 16, 0x215c, 0, 0x012e, 16, 186 + 210, 0, 7, 16, 12, 0, 5, 16, 5, 0, 1, 16, 1, 0, 10, 16, 1, 0, 13, 16, 187 + 1, 0, 5, 16, 1, 0, 1, 16, 1, 0, 2, 16, 1, 0, 2, 16, 1, 0, 108, 16, 188 + 33, 0, 0x016b, 16, 18, 0, 64, 16, 2, 0, 54, 16, 40, 0, 12, 16, 55, 0, 2, 16, 189 + 24, 0, 3, 16, 25, 0, 1, 16, 6, 0, 3, 16, 1, 0, 1, 16, 1, 0, 135, 16, 190 + 2, 0, 1, 17, 4, 0, 1, 16, 11, 0, 10, 17, 7, 0, 26, 16, 4, 0, 1, 16, 191 + 1, 0, 26, 16, 11, 0, 89, 16, 3, 0, 6, 16, 2, 0, 6, 16, 2, 0, 6, 16, 192 + 2, 0, 3, 16, 3, 0, 2, 16, 3, 0, 2, 16, 25, 0, 0 }; 193 + 194 + /** 195 + * Translates characters to character classes 196 + */ 197 + private static readonly char[] ZZ_CMAP; 198 + 199 + /** 200 + * Translates DFA states to action switch labels. 201 + */ 202 + private static readonly int [] ZZ_ACTION; 203 + 204 + private static readonly ushort[] ZZ_ACTION_PACKED_0 = new ushort[] { 205 + 1, 1, 1, 2, 12, 0, 1, 3, 1, 1, 2, 4, 1, 1, 1, 2, 206 + 3, 5, 1, 6, 1, 7, 2, 8, 1, 7, 1, 9, 1, 10, 1, 11, 207 + 1, 5, 1, 12, 1, 13, 1, 10, 1, 12, 2, 14, 1, 5, 1, 15, 208 + 1, 16, 2, 17, 1, 18, 2, 19, 1, 20, 1, 21, 1, 22, 1, 23, 209 + 1, 24, 1, 25, 1, 17, 1, 26, 1, 27, 1, 28, 1, 29, 1, 30, 210 + 1, 31, 1, 32, 1, 33, 1, 34, 1, 35, 3, 5, 1, 36, 1, 37, 211 + 1, 38, 1, 39, 1, 40, 1, 41, 1, 42, 1, 5, 2, 43, 1, 44, 212 + 3, 45, 1, 46, 1, 47, 1, 48, 1, 49, 1, 45, 1, 50, 1, 51, 213 + 1, 5, 2, 52, 1, 5, 1, 53, 1, 54, 1, 5, 1, 55, 1, 56, 214 + 2, 57, 1, 58, 3, 0, 1, 59, 1, 60, 1, 0, 1, 61, 1, 0, 215 + 2, 62, 1, 0, 13, 62, 3, 0, 1, 63, 1, 62, 1, 64, 1, 62, 216 + 2, 0, 1, 65, 1, 66, 1, 0, 1, 67, 1, 68, 2, 67, 1, 68, 217 + 1, 69, 1, 70, 1, 71, 1, 72, 1, 73, 1, 0, 1, 74, 1, 0, 218 + 1, 75, 1, 76, 1, 77, 4, 0, 2, 78, 8, 0, 1, 79, 1, 80, 219 + 2, 79, 1, 80, 1, 81, 1, 82, 1, 83, 1, 84, 1, 85, 1, 86, 220 + 3, 0, 1, 87, 5, 0, 1, 88, 1, 0, 1, 58, 2, 89, 1, 62, 221 + 2, 90, 28, 62, 3, 0, 2, 91, 1, 62, 2, 92, 1, 62, 2, 0, 222 + 1, 68, 1, 0, 1, 93, 5, 0, 1, 94, 2, 0, 1, 35, 4, 0, 223 + 1, 80, 1, 0, 1, 95, 1, 96, 2, 97, 3, 0, 2, 62, 1, 98, 224 + 20, 62, 1, 99, 9, 62, 3, 0, 2, 62, 2, 100, 1, 0, 1, 101, 225 + 1, 93, 12, 0, 1, 102, 1, 95, 3, 0, 16, 62, 1, 103, 3, 62, 226 + 1, 104, 7, 62, 1, 105, 6, 62, 1, 106, 1, 62, 1, 107, 1, 103, 227 + 1, 0, 2, 62, 1, 0, 1, 93, 11, 0, 1, 95, 5, 0, 9, 62, 228 + 1, 0, 1, 62, 1, 108, 5, 62, 1, 109, 1, 110, 14, 62, 1, 111, 229 + 1, 112, 2, 62, 1, 0, 1, 93, 6, 0, 2, 35, 6, 0, 1, 95, 230 + 2, 0, 2, 113, 3, 0, 9, 62, 1, 114, 9, 62, 1, 115, 3, 62, 231 + 1, 116, 1, 0, 3, 62, 1, 117, 1, 118, 2, 62, 6, 0, 1, 119, 232 + 1, 35, 3, 0, 1, 35, 6, 0, 2, 120, 4, 0, 1, 112, 1, 62, 233 + 1, 121, 1, 98, 3, 62, 1, 122, 2, 123, 1, 114, 1, 0, 9, 62, 234 + 2, 124, 1, 62, 1, 125, 1, 62, 2, 126, 1, 62, 1, 127, 6, 0, 235 + 1, 35, 6, 0, 1, 35, 11, 0, 1, 62, 1, 128, 2, 62, 1, 123, 236 + 1, 129, 1, 123, 1, 114, 1, 0, 2, 62, 1, 130, 2, 62, 1, 131, 237 + 3, 62, 1, 124, 1, 132, 1, 124, 1, 133, 1, 125, 1, 134, 1, 126, 238 + 2, 135, 1, 126, 4, 0, 1, 136, 1, 137, 2, 35, 4, 0, 2, 35, 239 + 7, 0, 2, 138, 1, 0, 3, 62, 2, 129, 1, 139, 2, 140, 1, 0, 240 + 1, 62, 1, 0, 5, 62, 2, 132, 2, 135, 2, 0, 1, 141, 2, 0, 241 + 1, 35, 2, 0, 2, 35, 4, 0, 1, 35, 2, 0, 2, 35, 7, 0, 242 + 2, 142, 1, 62, 1, 129, 1, 0, 1, 139, 1, 140, 1, 143, 1, 140, 243 + 2, 0, 2, 62, 1, 144, 1, 62, 1, 145, 1, 146, 2, 147, 1, 132, 244 + 4, 0, 1, 148, 1, 0, 4, 35, 3, 0, 4, 35, 3, 0, 2, 149, 245 + 1, 0, 1, 142, 1, 150, 1, 142, 1, 151, 2, 143, 2, 0, 2, 62, 246 + 1, 144, 2, 152, 1, 147, 1, 153, 1, 147, 7, 0, 3, 35, 5, 0, 247 + 3, 35, 1, 0, 2, 154, 1, 0, 2, 150, 1, 143, 3, 0, 2, 62, 248 + 1, 152, 1, 155, 1, 152, 2, 153, 1, 156, 1, 157, 4, 0, 1, 35, 249 + 3, 0, 1, 35, 2, 158, 1, 150, 1, 0, 1, 130, 1, 0, 1, 130, 250 + 1, 62, 2, 155, 1, 153, 4, 0, 1, 35, 2, 0, 1, 35, 2, 159, 251 + 1, 155, 4, 0, 1, 160, 0 }; 252 + 253 + private static int [] zzUnpackAction() { 254 + int [] result = new int[780]; 255 + int offset = 0; 256 + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); 257 + return result; 258 + } 259 + 260 + private static int zzUnpackAction(ushort[] packed, int offset, int [] result) { 261 + int i = 0; /* index in packed string */ 262 + int j = offset; /* index in unpacked array */ 263 + int l = packed.Length; 264 + while (i + 1 < l) { 265 + int count = packed[i++]; 266 + int value = packed[i++]; 267 + do result[j++] = value; while (--count > 0); 268 + } 269 + return j; 270 + } 271 + 272 + 273 + /** 274 + * Translates a state to a row index in the transition table 275 + */ 276 + private static readonly int [] ZZ_ROWMAP; 277 + 278 + private static readonly ushort[] ZZ_ROWMAP_PACKED_0 = new ushort[] { 279 + 0, 0, 0, 70, 0, 140, 0, 210, 0, 0x0118, 0, 0x015e, 0, 0x01a4, 0, 0x01ea, 280 + 0, 0x0230, 0, 0x0276, 0, 0x02bc, 0, 0x0302, 0, 0x0348, 0, 0x038e, 0, 0x03d4, 0, 0x041a, 281 + 0, 0x041a, 0, 0x0460, 0, 0x04a6, 0, 0x04ec, 0, 0x0532, 0, 0x0578, 0, 0x0460, 0, 0x05be, 282 + 0, 0x0604, 0, 0x0460, 0, 0x064a, 0, 0x0690, 0, 0x06d6, 0, 0x071c, 0, 0x0762, 0, 0x07a8, 283 + 0, 0x07ee, 0, 0x0834, 0, 0x087a, 0, 0x08c0, 0, 0x0906, 0, 0x094c, 0, 0x0992, 0, 0x0460, 284 + 0, 0x09d8, 0, 0x0460, 0, 0x0a1e, 0, 0x0a64, 0, 0x0aaa, 0, 0x0af0, 0, 0x0460, 0, 0x0b36, 285 + 0, 0x0460, 0, 0x0b7c, 0, 0x0460, 0, 0x0bc2, 0, 0x0c08, 0, 0x0c4e, 0, 0x0460, 0, 0x0460, 286 + 0, 0x0460, 0, 0x0460, 0, 0x0460, 0, 0x0460, 0, 0x0460, 0, 0x0460, 0, 0x0c94, 0, 0x0cda, 287 + 0, 0x0d20, 0, 0x0d66, 0, 0x0460, 0, 0x0460, 0, 0x0dac, 0, 0x0df2, 0, 0x0460, 0, 0x0e38, 288 + 0, 0x0e7e, 0, 0x0ec4, 0, 0x0460, 0, 0x0f0a, 0, 0x0460, 0, 0x0460, 0, 0x0a1e, 0, 0x0f50, 289 + 0, 0x0f50, 0, 0x0b36, 0, 0x0460, 0, 0x0460, 0, 0x0f96, 0, 0x0460, 0, 0x0fdc, 0, 0x1022, 290 + 0, 0x1022, 0, 0x0460, 0, 0x1068, 0, 0x10ae, 0, 0x0460, 0, 0x10f4, 0, 0x0460, 0, 0x113a, 291 + 0, 0x03d4, 0, 0x0460, 0, 0x1180, 0, 0x11c6, 0, 0x120c, 0, 0x0532, 0, 0x0460, 0, 0x0460, 292 + 0, 0x0578, 0, 0x0460, 0, 0x1252, 0, 0x1298, 0, 0x12de, 0, 0x1324, 0, 0x136a, 0, 0x13b0, 293 + 0, 0x13f6, 0, 0x143c, 0, 0x1482, 0, 0x14c8, 0, 0x150e, 0, 0x1554, 0, 0x159a, 0, 0x15e0, 294 + 0, 0x1626, 0, 0x166c, 0, 0x16b2, 0, 0x16f8, 0, 0x173e, 0, 0x1784, 0, 0x0460, 0, 0x17ca, 295 + 0, 0x1810, 0, 0x1856, 0, 0x0992, 0, 0x189c, 0, 0x0460, 0, 0x18e2, 0, 0x1928, 0, 0x0460, 296 + 0, 0x196e, 0, 0x19b4, 0, 0x19fa, 0, 0x1a40, 0, 0x0460, 0, 0x0460, 0, 0x0460, 0, 0x0460, 297 + 0, 0x0460, 0, 0x0aaa, 0, 0x0bc2, 0, 0x1a86, 0, 0x0460, 0, 0x1acc, 0, 0x1b12, 0, 0x1b58, 298 + 0, 0x0bc2, 0, 0x1b9e, 0, 0x0c4e, 0, 0x0460, 0, 0x1be4, 0, 0x0cda, 0, 0x0d20, 0, 0x0d66, 299 + 0, 0x1c2a, 0, 0x1c70, 0, 0x1cb6, 0, 0x1cfc, 0, 0x1d42, 0, 0x0460, 0, 0x1d88, 0, 0x1dce, 300 + 0, 0x1e14, 0, 0x1e5a, 0, 0x0460, 0, 0x0460, 0, 0x0460, 0, 0x0460, 0, 0x0460, 0, 0x0460, 301 + 0, 0x0f50, 0, 0x0b36, 0, 0x1ea0, 0, 0x0460, 0, 0x1022, 0, 0x1ee6, 0, 0x1f2c, 0, 0x1f72, 302 + 0, 0x1fb8, 0, 0x1ffe, 0, 0x10f4, 0, 0x0460, 0, 0x1252, 0, 0x0460, 0, 0x2044, 0, 0x1324, 303 + 0, 0x0460, 0, 0x208a, 0, 0x20d0, 0, 0x2116, 0, 0x215c, 0, 0x21a2, 0, 0x21e8, 0, 0x222e, 304 + 0, 0x2274, 0, 0x22ba, 0, 0x2300, 0, 0x2346, 0, 0x238c, 0, 0x23d2, 0, 0x2418, 0, 0x245e, 305 + 0, 0x24a4, 0, 0x24ea, 0, 0x2530, 0, 0x2576, 0, 0x25bc, 0, 0x2602, 0, 0x2648, 0, 0x268e, 306 + 0, 0x26d4, 0, 0x271a, 0, 0x2760, 0, 0x27a6, 0, 0x27ec, 0, 0x2832, 0, 0x2878, 0, 0x28be, 307 + 0, 0x2904, 0, 0x294a, 0, 0x2990, 0, 0x29d6, 0, 0x2a1c, 0, 0x2a62, 0, 0x2aa8, 0, 0x2aee, 308 + 0, 0x0460, 0, 0x2b34, 0, 0x2b7a, 0, 0x2bc0, 0, 0x2c06, 0, 0x2c4c, 0, 0x2c92, 0, 0x2cd8, 309 + 0, 0x0460, 0, 0x2d1e, 0, 0x2d64, 0, 0x2daa, 0, 0x2df0, 0, 0x2e36, 0, 0x2e7c, 0, 0x2ec2, 310 + 0, 0x0460, 0, 0x2f08, 0, 0x2f4e, 0, 0x0460, 0, 0x1ee6, 0, 0x0460, 0, 0x2f94, 0, 0x2fda, 311 + 0, 0x3020, 0, 0x3066, 0, 0x30ac, 0, 0x30f2, 0, 0x3138, 0, 0x317e, 0, 0x31c4, 0, 0x320a, 312 + 0, 0x3250, 0, 0x3296, 0, 0x32dc, 0, 0x3322, 0, 0x3368, 0, 0x33ae, 0, 0x33f4, 0, 0x343a, 313 + 0, 0x3480, 0, 0x34c6, 0, 0x350c, 0, 0x3552, 0, 0x3598, 0, 0x35de, 0, 0x3624, 0, 0x366a, 314 + 0, 0x36b0, 0, 0x36f6, 0, 0x373c, 0, 0x3782, 0, 0x37c8, 0, 0x380e, 0, 0x3854, 0, 0x389a, 315 + 0, 0x38e0, 0, 0x3926, 0, 0x396c, 0, 0x39b2, 0, 0x39f8, 0, 0x3a3e, 0, 0x3a84, 0, 0x2aa8, 316 + 0, 0x0460, 0, 0x3aca, 0, 0x0460, 0, 0x3b10, 0, 0x3b56, 0, 0x3b9c, 0, 0x3be2, 0, 0x3c28, 317 + 0, 0x3c6e, 0, 0x3cb4, 0, 0x3cfa, 0, 0x3d40, 0, 0x3d86, 0, 0x3dcc, 0, 0x3e12, 0, 0x3e58, 318 + 0, 0x0460, 0, 0x3e9e, 0, 0x3ee4, 0, 0x3f2a, 0, 0x3f70, 0, 0x3fb6, 0, 0x3ffc, 0, 0x4042, 319 + 0, 0x4088, 0, 0x40ce, 0, 0x4114, 0, 0x415a, 0, 0x41a0, 0, 0x41e6, 0, 0x422c, 0, 0x4272, 320 + 0, 0x42b8, 0, 0x42fe, 0, 0x4344, 0, 0x438a, 0, 0x43d0, 0, 0x1298, 0, 0x4416, 0, 0x445c, 321 + 0, 0x44a2, 0, 0x1298, 0, 0x44e8, 0, 0x452e, 0, 0x4574, 0, 0x45ba, 0, 0x4600, 0, 0x4646, 322 + 0, 0x468c, 0, 0x1298, 0, 0x46d2, 0, 0x4718, 0, 0x475e, 0, 0x47a4, 0, 0x47ea, 0, 0x4830, 323 + 0, 0x1298, 0, 0x4876, 0, 0x0460, 0, 0x0460, 0, 0x48bc, 0, 0x4902, 0, 0x4948, 0, 0x498e, 324 + 0, 0x49d4, 0, 0x4a1a, 0, 0x4a60, 0, 0x4aa6, 0, 0x4aec, 0, 0x4b32, 0, 0x4b78, 0, 0x4bbe, 325 + 0, 0x4c04, 0, 0x4c4a, 0, 0x4c90, 0, 0x4cd6, 0, 0x4d1c, 0, 0x4d62, 0, 0x4da8, 0, 0x4dee, 326 + 0, 0x4e34, 0, 0x4e7a, 0, 0x4ec0, 0, 0x4f06, 0, 0x4f4c, 0, 0x4f92, 0, 0x4fd8, 0, 0x501e, 327 + 0, 0x5064, 0, 0x50aa, 0, 0x50f0, 0, 0x5136, 0, 0x517c, 0, 0x1298, 0, 0x51c2, 0, 0x5208, 328 + 0, 0x524e, 0, 0x5294, 0, 0x52da, 0, 0x1298, 0, 0x1298, 0, 0x5320, 0, 0x5366, 0, 0x53ac, 329 + 0, 0x53f2, 0, 0x5438, 0, 0x547e, 0, 0x54c4, 0, 0x550a, 0, 0x5550, 0, 0x5596, 0, 0x55dc, 330 + 0, 0x5622, 0, 0x5668, 0, 0x56ae, 0, 0x1298, 0, 0x0460, 0, 0x56f4, 0, 0x573a, 0, 0x5780, 331 + 0, 0x0460, 0, 0x57c6, 0, 0x580c, 0, 0x5852, 0, 0x5898, 0, 0x58de, 0, 0x5924, 0, 0x596a, 332 + 0, 0x59b0, 0, 0x59f6, 0, 0x5a3c, 0, 0x5a82, 0, 0x5ac8, 0, 0x5b0e, 0, 0x5b54, 0, 0x0460, 333 + 0, 0x5b9a, 0, 0x5be0, 0, 0x4da8, 0, 0x0460, 0, 0x5c26, 0, 0x5c6c, 0, 0x5cb2, 0, 0x5cf8, 334 + 0, 0x5d3e, 0, 0x5d84, 0, 0x5dca, 0, 0x5e10, 0, 0x5e56, 0, 0x5e9c, 0, 0x5ee2, 0, 0x5f28, 335 + 0, 0x5f6e, 0, 0x5fb4, 0, 0x5ffa, 0, 0x6040, 0, 0x6086, 0, 0x60cc, 0, 0x6112, 0, 0x6158, 336 + 0, 0x619e, 0, 0x61e4, 0, 0x1298, 0, 0x622a, 0, 0x6270, 0, 0x62b6, 0, 0x1298, 0, 0x62fc, 337 + 0, 0x6342, 0, 0x6388, 0, 0x63ce, 0, 0x1298, 0, 0x1298, 0, 0x6414, 0, 0x2a1c, 0, 0x645a, 338 + 0, 0x64a0, 0, 0x64e6, 0, 0x652c, 0, 0x6572, 0, 0x65b8, 0, 0x65fe, 0, 0x6644, 0, 0x668a, 339 + 0, 0x66d0, 0, 0x6716, 0, 0x675c, 0, 0x67a2, 0, 0x67e8, 0, 0x682e, 0, 0x6874, 0, 0x68ba, 340 + 0, 0x6900, 0, 0x5b9a, 0, 0x0460, 0, 0x6946, 0, 0x698c, 0, 0x69d2, 0, 0x6a18, 0, 0x1298, 341 + 0, 0x6a5e, 0, 0x1298, 0, 0x1298, 0, 0x6aa4, 0, 0x6aea, 0, 0x6b30, 0, 0x1298, 0, 0x6b76, 342 + 0, 0x6bbc, 0, 0x6c02, 0, 0x6c48, 0, 0x6c8e, 0, 0x6cd4, 0, 0x6d1a, 0, 0x6d60, 0, 0x6da6, 343 + 0, 0x6dec, 0, 0x6e32, 0, 0x6e78, 0, 0x6ebe, 0, 0x6f04, 0, 0x6f4a, 0, 0x6f90, 0, 0x6fd6, 344 + 0, 0x701c, 0, 0x7062, 0, 0x70a8, 0, 0x294a, 0, 0x0460, 0, 0x70ee, 0, 0x7134, 0, 0x717a, 345 + 0, 0x71c0, 0, 0x7206, 0, 0x724c, 0, 0x7292, 0, 0x72d8, 0, 0x731e, 0, 0x7364, 0, 0x73aa, 346 + 0, 0x73f0, 0, 0x7436, 0, 0x747c, 0, 0x74c2, 0, 0x7508, 0, 0x754e, 0, 0x7594, 0, 0x75da, 347 + 0, 0x7620, 0, 0x7666, 0, 0x76ac, 0, 0x76f2, 0, 0x7738, 0, 0x777e, 0, 0x77c4, 0, 0x780a, 348 + 0, 0x7850, 0, 0x7896, 0, 0x78dc, 0, 0x7922, 0, 0x7968, 0, 0x79ae, 0, 0x79f4, 0, 0x7a3a, 349 + 0, 0x7a80, 0, 0x7ac6, 0, 0x7b0c, 0, 0x7b52, 0, 0x1298, 0, 0x7b98, 0, 0x7bde, 0, 0x7c24, 350 + 0, 0x7c6a, 0, 0x7cb0, 0, 0x7cf6, 0, 0x1298, 0, 0x7d3c, 0, 0x1298, 0, 0x7d82, 0, 0x7dc8, 351 + 0, 0x7e0e, 0, 0x7e54, 0, 0x7e9a, 0, 0x7ee0, 0, 0x7f26, 0, 0x7f6c, 0, 0x0460, 0, 0x0460, 352 + 0, 0x7fb2, 0, 0x7ff8, 0, 0x803e, 0, 0x8084, 0, 0x80ca, 0, 0x8110, 0, 0x8156, 0, 0x819c, 353 + 0, 0x81e2, 0, 0x8228, 0, 0x826e, 0, 0x82b4, 0, 0x82fa, 0, 0x8340, 0, 0x8386, 0, 0x7738, 354 + 0, 0x0460, 0, 0x83cc, 0, 0x8412, 0, 0x8458, 0, 0x849e, 0, 0x84e4, 0, 0x852a, 0, 0x8570, 355 + 0, 0x85b6, 0, 0x85fc, 0, 0x8642, 0, 0x8688, 0, 0x86ce, 0, 0x8714, 0, 0x875a, 0, 0x87a0, 356 + 0, 0x87e6, 0, 0x882c, 0, 0x8872, 0, 0x88b8, 0, 0x88fe, 0, 0x8944, 0, 0x898a, 0, 0x89d0, 357 + 0, 0x0460, 0, 0x8a16, 0, 0x8a5c, 0, 0x8aa2, 0, 0x8ae8, 0, 0x8b2e, 0, 0x8b74, 0, 0x8bba, 358 + 0, 0x8c00, 0, 0x8c46, 0, 0x8c8c, 0, 0x8cd2, 0, 0x8d18, 0, 0x8d5e, 0, 0x8da4, 0, 0x8dea, 359 + 0, 0x8e30, 0, 0x8e76, 0, 0x8ebc, 0, 0x8f02, 0, 0x8f48, 0, 0x8f8e, 0, 0x8fd4, 0, 0x901a, 360 + 0, 0x9060, 0, 0x90a6, 0, 0x90ec, 0, 0x9132, 0, 0x9178, 0, 0x91be, 0, 0x9204, 0, 0x924a, 361 + 0, 0x9290, 0, 0x92d6, 0, 0x931c, 0, 0x9362, 0, 0x93a8, 0, 0x93ee, 0, 0x9434, 0, 0x1298, 362 + 0, 0x1298, 0, 0x947a, 0, 0x94c0, 0, 0x9506, 0, 0x954c, 0, 0x9592, 0, 0x95d8, 0, 0x961e, 363 + 0, 0x0460, 0, 0x9664, 0, 0x96aa, 0, 0x96f0, 0, 0x9736, 0, 0x977c, 0, 0x97c2, 0, 0x9808, 364 + 0, 0x984e, 0, 0x9894, 0, 0x98da, 0, 0x9920, 0, 0x9966, 0, 0x99ac, 0, 0x99f2, 0, 0x9a38, 365 + 0, 0x8fd4, 0, 0x0460, 0, 0x9a7e, 0, 0x9ac4, 0, 0x9b0a, 0, 0x9b50, 0, 0x9b96, 0, 0x9bdc, 366 + 0, 0x9c22, 0, 0x9c68, 0, 0x9cae, 0, 0x9cf4, 0, 0x9d3a, 0, 0x9d80, 0, 0x9dc6, 0, 0x9e0c, 367 + 0, 0x9e52, 0, 0x9e98, 0, 0x9ede, 0, 0x9f24, 0, 0x9f6a, 0, 0x9fb0, 0, 0x9ff6, 0, 0xa03c, 368 + 0, 0xa082, 0, 0xa0c8, 0, 0xa10e, 0, 0xa154, 0, 0xa19a, 0, 0xa1e0, 0, 0xa226, 0, 0xa26c, 369 + 0, 0xa2b2, 0, 0xa2f8, 0, 0xa33e, 0, 0xa384, 0, 0xa3ca, 0, 0xa410, 0, 0x9a38, 0, 0x0460, 370 + 0, 0xa456, 0, 0xa49c, 0, 0xa4e2, 0, 0xa528, 0, 0xa56e, 0, 0xa5b4, 0, 0xa5fa, 0, 0xa640, 371 + 0, 0xa686, 0, 0xa6cc, 0, 0xa712, 0, 0xa758, 0, 0xa79e, 0, 0xa7e4, 0, 0x0460, 0, 0x0460, 372 + 0, 0xa82a, 0, 0xa870, 0, 0xa8b6, 0, 0xa8fc, 0, 0xa942, 0, 0xa988, 0, 0xa9ce, 0, 0xaa14, 373 + 0, 0xaa5a, 0, 0xa456, 0, 0x0460, 0, 0xaaa0, 0, 0xaae6, 0, 0x0460, 0, 0xab2c, 0, 0x1298, 374 + 0, 0xab72, 0, 0xabb8, 0, 0xabfe, 0, 0xac44, 0, 0xac8a, 0, 0xacd0, 0, 0xad16, 0, 0xad5c, 375 + 0, 0xada2, 0, 0xade8, 0, 0xae2e, 0, 0xae74, 0, 0x0460, 0, 0x1298, 0, 0xaeba, 0, 0xaf00, 376 + 0, 0xaf46, 0, 0xaf8c, 0, 0xafd2, 0, 0x0460, 0 }; 377 + 378 + private static int [] zzUnpackRowMap() { 379 + int [] result = new int[780]; 380 + int offset = 0; 381 + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); 382 + return result; 383 + } 384 + 385 + private static int zzUnpackRowMap(ushort[] packed, int offset, int [] result) { 386 + int i = 0; /* index in packed string */ 387 + int j = offset; /* index in unpacked array */ 388 + int l = packed.Length; 389 + while (i + 1 < l) { 390 + int high = packed[i++] << 16; 391 + result[j++] = high | packed[i++]; 392 + } 393 + return j; 394 + } 395 + 396 + /** 397 + * The transition table of the DFA 398 + */ 399 + private static readonly int [] ZZ_TRANS; 400 + 401 + private static readonly ushort[] ZZ_TRANS_PACKED_0 = new ushort[] { 402 + 9, 16, 2, 17, 1, 18, 7, 16, 1, 17, 5, 16, 1, 19, 44, 16, 403 + 20, 20, 1, 21, 1, 22, 48, 20, 2, 23, 1, 24, 2, 23, 2, 24, 404 + 1, 23, 1, 25, 1, 26, 1, 27, 1, 26, 1, 23, 1, 28, 2, 23, 405 + 1, 24, 2, 23, 1, 26, 7, 23, 21, 24, 4, 23, 1, 24, 2, 23, 406 + 3, 24, 8, 23, 1, 24, 5, 23, 1, 29, 2, 23, 2, 29, 1, 23, 407 + 1, 30, 3, 31, 4, 23, 1, 29, 1, 23, 1, 30, 1, 31, 1, 23, 408 + 1, 32, 3, 23, 1, 33, 1, 23, 21, 29, 4, 23, 1, 29, 1, 34, 409 + 1, 23, 3, 29, 8, 23, 1, 29, 5, 23, 1, 29, 2, 23, 2, 29, 410 + 1, 23, 1, 35, 3, 31, 4, 23, 1, 29, 1, 23, 1, 35, 1, 31, 411 + 1, 23, 1, 32, 3, 23, 1, 36, 1, 23, 21, 29, 4, 23, 1, 29, 412 + 1, 34, 1, 23, 3, 29, 8, 23, 1, 29, 11, 23, 1, 37, 3, 38, 413 + 6, 23, 1, 37, 1, 38, 1, 23, 1, 39, 2, 23, 1, 40, 29, 23, 414 + 1, 41, 15, 23, 4, 42, 1, 43, 3, 42, 1, 44, 1, 45, 1, 46, 415 + 1, 45, 1, 47, 1, 42, 1, 48, 3, 42, 1, 44, 1, 45, 1, 49, 416 + 1, 50, 1, 51, 3, 42, 1, 52, 27, 42, 1, 53, 4, 42, 1, 54, 417 + 1, 55, 1, 56, 1, 57, 1, 58, 1, 59, 1, 60, 1, 61, 1, 62, 418 + 2, 42, 21, 63, 1, 64, 1, 65, 1, 66, 1, 67, 1, 63, 1, 68, 419 + 43, 63, 2, 23, 1, 69, 2, 23, 2, 69, 1, 23, 4, 70, 1, 23, 420 + 1, 71, 2, 23, 1, 69, 1, 23, 2, 70, 7, 23, 21, 69, 4, 23, 421 + 1, 69, 2, 23, 3, 69, 1, 72, 7, 23, 1, 69, 3, 23, 4, 73, 422 + 1, 74, 4, 73, 1, 75, 1, 76, 1, 75, 7, 73, 1, 75, 2, 73, 423 + 1, 77, 47, 73, 4, 78, 1, 79, 3, 78, 3, 80, 1, 81, 2, 78, 424 + 1, 82, 1, 83, 2, 78, 2, 80, 2, 78, 1, 84, 3, 78, 1, 85, 425 + 40, 78, 1, 86, 1, 78, 1, 87, 9, 88, 2, 89, 1, 90, 7, 88, 426 + 1, 89, 5, 88, 1, 91, 44, 88, 8, 23, 1, 92, 2, 23, 1, 93, 427 + 1, 23, 1, 94, 4, 23, 1, 92, 5, 23, 1, 95, 53, 23, 4, 96, 428 + 6, 23, 2, 96, 50, 23, 9, 15, 2, 97, 1, 98, 7, 15, 1, 97, 429 + 50, 15, 9, 16, 2, 17, 1, 18, 7, 16, 1, 17, 50, 16, 70, 0, 430 + 9, 16, 2, 17, 1, 18, 7, 16, 1, 17, 5, 16, 1, 99, 44, 16, 431 + 20, 20, 1, 100, 1, 101, 68, 20, 1, 102, 1, 103, 68, 20, 1, 104, 432 + 1, 105, 48, 20, 1, 0, 3, 24, 1, 0, 3, 24, 8, 0, 4, 24, 433 + 7, 0, 26, 24, 2, 0, 3, 24, 8, 0, 1, 24, 11, 0, 1, 25, 434 + 4, 0, 1, 28, 67, 0, 1, 26, 66, 0, 1, 28, 62, 0, 3, 29, 435 + 1, 0, 3, 29, 8, 0, 4, 29, 7, 0, 26, 29, 2, 0, 3, 29, 436 + 8, 0, 1, 29, 11, 0, 1, 30, 9, 0, 1, 30, 60, 0, 3, 31, 437 + 7, 0, 1, 31, 70, 0, 1, 106, 1, 107, 50, 0, 1, 108, 2, 0, 438 + 1, 108, 1, 109, 9, 0, 1, 108, 9, 0, 1, 110, 1, 111, 1, 112, 439 + 1, 113, 4, 108, 1, 114, 1, 115, 1, 116, 1, 117, 1, 108, 1, 118, 440 + 1, 119, 1, 120, 1, 108, 1, 121, 1, 108, 1, 122, 1, 123, 1, 108, 441 + 1, 124, 1, 125, 1, 126, 1, 0, 1, 108, 2, 0, 3, 108, 8, 0, 442 + 1, 108, 11, 0, 1, 34, 9, 0, 1, 34, 59, 0, 1, 35, 9, 0, 443 + 1, 35, 6, 0, 1, 127, 46, 0, 1, 108, 2, 0, 1, 128, 1, 109, 444 + 9, 0, 1, 108, 8, 0, 1, 129, 1, 110, 1, 111, 1, 112, 1, 113, 445 + 4, 108, 1, 114, 1, 115, 1, 116, 1, 117, 1, 108, 1, 118, 1, 130, 446 + 1, 120, 1, 108, 1, 121, 1, 108, 1, 122, 1, 123, 1, 108, 1, 124, 447 + 1, 125, 1, 126, 1, 0, 1, 108, 2, 0, 3, 108, 8, 0, 1, 108, 448 + 11, 0, 1, 37, 3, 38, 6, 0, 1, 37, 1, 38, 1, 0, 1, 131, 449 + 2, 0, 1, 40, 29, 0, 1, 41, 23, 0, 1, 37, 3, 38, 6, 0, 450 + 1, 37, 1, 38, 1, 0, 1, 131, 2, 0, 1, 40, 1, 132, 28, 0, 451 + 1, 41, 35, 0, 1, 133, 1, 134, 102, 0, 1, 135, 15, 0, 3, 136, 452 + 1, 137, 1, 136, 1, 138, 1, 139, 1, 140, 3, 136, 1, 0, 16, 136, 453 + 1, 141, 1, 142, 1, 136, 1, 143, 3, 136, 1, 144, 7, 136, 1, 145, 454 + 4, 136, 1, 137, 1, 136, 1, 140, 1, 137, 18, 136, 8, 0, 1, 44, 455 + 3, 146, 1, 47, 1, 0, 1, 48, 3, 0, 1, 44, 1, 146, 1, 49, 456 + 1, 50, 1, 51, 3, 0, 1, 147, 32, 0, 1, 54, 1, 55, 1, 56, 457 + 1, 57, 1, 58, 1, 59, 1, 60, 1, 61, 1, 62, 10, 0, 4, 146, 458 + 1, 47, 1, 0, 1, 48, 3, 0, 2, 146, 1, 49, 1, 50, 1, 51, 459 + 3, 0, 1, 147, 32, 0, 1, 54, 1, 55, 1, 56, 1, 57, 1, 58, 460 + 1, 59, 1, 60, 1, 61, 1, 62, 10, 0, 3, 146, 1, 45, 1, 47, 461 + 1, 0, 1, 48, 3, 0, 2, 146, 1, 49, 1, 50, 1, 51, 3, 0, 462 + 1, 147, 32, 0, 1, 54, 1, 55, 1, 56, 1, 57, 1, 58, 1, 59, 463 + 1, 60, 1, 61, 1, 62, 70, 0, 1, 148, 21, 0, 1, 149, 1, 150, 464 + 49, 0, 1, 151, 1, 152, 1, 151, 1, 0, 2, 152, 1, 151, 1, 153, 465 + 7, 0, 1, 152, 1, 0, 1, 153, 8, 0, 21, 152, 4, 151, 1, 152, 466 + 2, 0, 3, 152, 8, 0, 1, 152, 57, 0, 1, 154, 23, 0, 1, 155, 467 + 1, 156, 1, 157, 1, 156, 6, 0, 1, 155, 1, 156, 50, 0, 21, 63, 468 + 1, 158, 1, 159, 1, 160, 1, 0, 1, 63, 1, 0, 63, 63, 1, 161, 469 + 1, 162, 48, 63, 4, 159, 1, 163, 4, 159, 3, 0, 7, 159, 1, 0, 470 + 2, 159, 1, 63, 47, 159, 4, 164, 1, 165, 4, 164, 3, 0, 7, 164, 471 + 1, 0, 3, 164, 1, 0, 46, 164, 1, 0, 3, 69, 1, 0, 3, 69, 472 + 8, 0, 4, 69, 7, 0, 26, 69, 2, 0, 3, 69, 8, 0, 1, 69, 473 + 11, 0, 4, 70, 6, 0, 2, 70, 58, 0, 4, 72, 6, 0, 2, 72, 474 + 50, 0, 4, 73, 1, 0, 4, 73, 3, 0, 7, 73, 1, 0, 2, 73, 475 + 1, 0, 47, 73, 3, 166, 1, 167, 1, 166, 1, 168, 1, 169, 1, 170, 476 + 3, 166, 1, 0, 10, 166, 1, 171, 5, 166, 1, 172, 1, 173, 1, 166, 477 + 1, 174, 3, 166, 1, 175, 7, 166, 1, 176, 4, 166, 1, 167, 1, 166, 478 + 1, 170, 1, 167, 18, 166, 11, 0, 1, 75, 66, 0, 4, 177, 2, 0, 479 + 1, 178, 3, 0, 2, 177, 52, 0, 1, 179, 2, 0, 2, 179, 9, 0, 480 + 1, 179, 10, 0, 21, 179, 4, 0, 1, 179, 2, 0, 3, 179, 8, 0, 481 + 1, 179, 18, 0, 1, 180, 54, 0, 9, 181, 2, 89, 1, 90, 7, 181, 482 + 1, 89, 59, 181, 2, 89, 1, 90, 7, 181, 1, 89, 4, 181, 1, 182, 483 + 2, 181, 1, 183, 6, 181, 1, 184, 1, 181, 1, 185, 33, 181, 8, 0, 484 + 1, 92, 9, 0, 1, 92, 52, 0, 1, 186, 1, 0, 1, 186, 3, 0, 485 + 1, 186, 1, 187, 9, 0, 1, 187, 29, 0, 4, 186, 26, 0, 4, 96, 486 + 6, 0, 2, 96, 50, 0, 11, 99, 1, 188, 58, 99, 20, 20, 1, 100, 487 + 1, 0, 68, 20, 1, 0, 1, 101, 48, 20, 9, 107, 2, 189, 1, 190, 488 + 7, 107, 1, 189, 50, 107, 1, 0, 3, 108, 1, 0, 3, 108, 8, 0, 489 + 4, 108, 7, 0, 26, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 490 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 1, 108, 1, 191, 491 + 24, 108, 2, 0, 3, 108, 8, 0, 1, 108, 3, 0, 9, 110, 2, 192, 492 + 1, 193, 7, 110, 1, 192, 50, 110, 1, 0, 3, 108, 1, 0, 3, 108, 493 + 8, 0, 4, 108, 7, 0, 1, 108, 1, 194, 13, 108, 1, 195, 4, 108, 494 + 1, 196, 5, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 495 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 5, 108, 1, 197, 20, 108, 496 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 497 + 8, 0, 4, 108, 7, 0, 3, 108, 1, 198, 5, 108, 1, 199, 2, 108, 498 + 1, 200, 13, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 499 + 1, 0, 1, 201, 2, 108, 8, 0, 4, 108, 7, 0, 5, 108, 1, 202, 500 + 20, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 501 + 1, 108, 1, 203, 1, 108, 8, 0, 4, 108, 7, 0, 1, 204, 25, 108, 502 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 503 + 8, 0, 4, 108, 7, 0, 9, 108, 1, 205, 16, 108, 2, 0, 3, 108, 504 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 505 + 7, 0, 1, 206, 25, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 506 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 16, 108, 1, 207, 507 + 1, 108, 1, 208, 7, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 508 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 2, 108, 1, 209, 509 + 3, 108, 1, 210, 7, 108, 1, 211, 11, 108, 2, 0, 3, 108, 8, 0, 510 + 1, 108, 4, 0, 3, 108, 1, 0, 1, 108, 1, 212, 1, 108, 8, 0, 511 + 4, 108, 7, 0, 3, 108, 1, 213, 1, 108, 1, 214, 4, 108, 1, 215, 512 + 1, 108, 1, 216, 13, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 513 + 3, 108, 1, 0, 1, 108, 1, 217, 1, 108, 8, 0, 4, 108, 7, 0, 514 + 9, 108, 1, 218, 16, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 515 + 3, 108, 1, 0, 1, 108, 1, 219, 1, 108, 8, 0, 4, 108, 7, 0, 516 + 12, 108, 1, 220, 13, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 517 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 7, 108, 1, 221, 518 + 18, 108, 2, 0, 3, 108, 8, 0, 1, 108, 46, 0, 1, 222, 69, 0, 519 + 1, 223, 77, 0, 1, 224, 19, 0, 3, 108, 1, 0, 3, 108, 1, 225, 520 + 7, 0, 2, 108, 1, 226, 1, 108, 7, 0, 13, 108, 1, 227, 12, 108, 521 + 2, 0, 3, 108, 8, 0, 1, 108, 3, 0, 9, 129, 3, 0, 7, 129, 522 + 1, 0, 50, 129, 1, 0, 3, 108, 1, 0, 3, 108, 1, 228, 7, 0, 523 + 2, 108, 1, 229, 1, 108, 7, 0, 2, 108, 1, 230, 3, 108, 1, 210, 524 + 7, 108, 1, 211, 11, 108, 2, 0, 3, 108, 8, 0, 1, 108, 28, 0, 525 + 1, 231, 44, 0, 9, 134, 3, 0, 7, 134, 1, 0, 50, 134, 55, 0, 526 + 1, 232, 17, 0, 1, 233, 3, 0, 1, 233, 40, 0, 1, 233, 1, 0, 527 + 2, 233, 19, 0, 3, 234, 3, 0, 1, 234, 26, 0, 2, 234, 3, 0, 528 + 1, 234, 1, 0, 1, 234, 1, 0, 1, 234, 2, 0, 1, 234, 1, 0, 529 + 4, 234, 3, 0, 1, 234, 1, 0, 1, 234, 13, 0, 3, 235, 3, 0, 530 + 1, 235, 26, 0, 2, 235, 3, 0, 1, 235, 1, 0, 1, 235, 1, 0, 531 + 1, 235, 2, 0, 1, 235, 1, 0, 4, 235, 3, 0, 1, 235, 1, 0, 532 + 1, 235, 15, 0, 1, 137, 3, 0, 1, 137, 40, 0, 1, 137, 1, 0, 533 + 2, 137, 24, 0, 1, 236, 30, 0, 1, 237, 6, 0, 1, 238, 1, 0, 534 + 1, 239, 23, 0, 9, 150, 3, 0, 7, 150, 1, 0, 50, 150, 1, 0, 535 + 1, 151, 1, 0, 1, 151, 3, 0, 1, 151, 40, 0, 4, 151, 19, 0, 536 + 3, 152, 1, 0, 3, 152, 1, 240, 7, 0, 4, 152, 4, 0, 1, 241, 537 + 2, 0, 26, 152, 2, 0, 3, 152, 8, 0, 1, 152, 58, 0, 1, 242, 538 + 25, 0, 1, 156, 58, 0, 20, 161, 1, 243, 49, 161, 9, 162, 2, 244, 539 + 1, 63, 7, 162, 1, 244, 50, 162, 9, 159, 3, 0, 7, 159, 1, 0, 540 + 50, 159, 23, 0, 1, 63, 46, 0, 3, 164, 1, 245, 1, 246, 1, 164, 541 + 1, 247, 1, 248, 1, 164, 3, 0, 7, 164, 1, 0, 28, 164, 1, 245, 542 + 1, 164, 1, 248, 1, 245, 18, 164, 3, 0, 1, 249, 3, 0, 1, 249, 543 + 40, 0, 1, 249, 1, 0, 2, 249, 19, 0, 3, 250, 3, 0, 1, 250, 544 + 26, 0, 2, 250, 3, 0, 1, 250, 1, 0, 1, 250, 1, 0, 1, 250, 545 + 2, 0, 1, 250, 1, 0, 4, 250, 3, 0, 1, 250, 1, 0, 1, 250, 546 + 13, 0, 3, 251, 3, 0, 1, 251, 26, 0, 2, 251, 3, 0, 1, 251, 547 + 1, 0, 1, 251, 1, 0, 1, 251, 2, 0, 1, 251, 1, 0, 4, 251, 548 + 3, 0, 1, 251, 1, 0, 1, 251, 15, 0, 1, 167, 3, 0, 1, 167, 549 + 40, 0, 1, 167, 1, 0, 2, 167, 19, 0, 3, 179, 1, 0, 3, 179, 550 + 8, 0, 4, 179, 4, 0, 1, 252, 2, 0, 26, 179, 2, 0, 3, 179, 551 + 8, 0, 1, 179, 3, 0, 9, 182, 2, 253, 1, 254, 7, 182, 1, 253, 552 + 50, 182, 9, 181, 2, 89, 1, 90, 7, 181, 1, 89, 8, 181, 1, 255, 553 + 50, 181, 2, 89, 1, 90, 7, 181, 1, 89, 12, 181, 1, 0x0100, 46, 181, 554 + 2, 89, 1, 90, 7, 181, 1, 89, 16, 181, 1, 0x0101, 33, 181, 1, 0, 555 + 1, 186, 1, 0, 1, 186, 3, 0, 1, 186, 40, 0, 4, 186, 19, 0, 556 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 1, 0x0102, 25, 108, 557 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 558 + 8, 0, 4, 108, 7, 0, 1, 0x0103, 1, 108, 1, 0x0104, 11, 108, 1, 0x0105, 559 + 11, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 560 + 3, 108, 8, 0, 4, 108, 7, 0, 18, 108, 1, 0x0106, 7, 108, 2, 0, 561 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 562 + 4, 108, 7, 0, 1, 108, 1, 0x0107, 24, 108, 2, 0, 3, 108, 8, 0, 563 + 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 564 + 2, 108, 1, 0x0108, 23, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 565 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 4, 108, 1, 0x0109, 566 + 21, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 567 + 3, 108, 8, 0, 4, 108, 7, 0, 18, 108, 1, 0x010a, 7, 108, 2, 0, 568 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 569 + 4, 108, 7, 0, 16, 108, 1, 0x010b, 9, 108, 2, 0, 3, 108, 8, 0, 570 + 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 571 + 2, 108, 1, 0x010c, 23, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 572 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 8, 108, 1, 0x010d, 573 + 17, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 574 + 3, 108, 8, 0, 4, 108, 7, 0, 1, 108, 1, 0x010e, 8, 108, 1, 0x010f, 575 + 15, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 576 + 3, 108, 8, 0, 4, 108, 7, 0, 1, 108, 1, 0x0110, 24, 108, 2, 0, 577 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 578 + 4, 108, 7, 0, 7, 108, 1, 0x0111, 2, 108, 1, 0x0112, 15, 108, 2, 0, 579 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 580 + 4, 108, 7, 0, 1, 108, 1, 0x0113, 24, 108, 2, 0, 3, 108, 8, 0, 581 + 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 582 + 13, 108, 1, 0x0114, 12, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 583 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 1, 0x0115, 25, 108, 584 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 585 + 8, 0, 4, 108, 7, 0, 12, 108, 1, 0x0116, 13, 108, 2, 0, 3, 108, 586 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 587 + 7, 0, 1, 0x0117, 25, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 588 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 12, 108, 1, 0x0118, 589 + 13, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 590 + 3, 108, 8, 0, 4, 108, 7, 0, 18, 108, 1, 0x0119, 7, 108, 2, 0, 591 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 592 + 4, 108, 7, 0, 12, 108, 1, 0x011a, 13, 108, 2, 0, 3, 108, 8, 0, 593 + 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 594 + 10, 108, 1, 0x011b, 15, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 595 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 12, 108, 1, 0x011c, 596 + 13, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 597 + 3, 108, 8, 0, 4, 108, 7, 0, 13, 108, 1, 0x011d, 12, 108, 2, 0, 598 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 599 + 4, 108, 7, 0, 8, 108, 1, 0x011e, 17, 108, 2, 0, 3, 108, 8, 0, 600 + 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 601 + 12, 108, 1, 0x011f, 13, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 602 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 16, 108, 1, 0x0120, 603 + 9, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 604 + 3, 108, 8, 0, 4, 108, 7, 0, 14, 108, 1, 0x0121, 11, 108, 2, 0, 605 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 606 + 4, 108, 7, 0, 16, 108, 1, 0x0122, 9, 108, 2, 0, 3, 108, 8, 0, 607 + 1, 108, 30, 0, 1, 0x0123, 69, 0, 1, 0x0124, 85, 0, 1, 0x0125, 34, 0, 608 + 1, 225, 9, 0, 1, 225, 52, 0, 3, 108, 1, 0, 3, 108, 1, 225, 609 + 7, 0, 2, 108, 1, 226, 1, 108, 7, 0, 26, 108, 2, 0, 3, 108, 610 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 611 + 7, 0, 2, 108, 1, 0x0126, 23, 108, 2, 0, 3, 108, 8, 0, 1, 108, 612 + 11, 0, 1, 228, 9, 0, 1, 228, 52, 0, 3, 108, 1, 0, 3, 108, 613 + 1, 228, 7, 0, 2, 108, 1, 229, 1, 108, 7, 0, 26, 108, 2, 0, 614 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 615 + 4, 108, 7, 0, 12, 108, 1, 0x0127, 13, 108, 2, 0, 3, 108, 8, 0, 616 + 1, 108, 3, 0, 9, 231, 2, 0x0128, 1, 0x0129, 7, 231, 1, 0x0128, 50, 231, 617 + 56, 0, 1, 0x012a, 14, 0, 3, 0x012b, 3, 0, 1, 0x012b, 26, 0, 2, 0x012b, 618 + 3, 0, 1, 0x012b, 1, 0, 1, 0x012b, 1, 0, 1, 0x012b, 2, 0, 1, 0x012b, 619 + 1, 0, 4, 0x012b, 3, 0, 1, 0x012b, 1, 0, 1, 0x012b, 13, 0, 3, 0x012c, 620 + 3, 0, 1, 0x012c, 26, 0, 2, 0x012c, 3, 0, 1, 0x012c, 1, 0, 1, 0x012c, 621 + 1, 0, 1, 0x012c, 2, 0, 1, 0x012c, 1, 0, 4, 0x012c, 3, 0, 1, 0x012c, 622 + 1, 0, 1, 0x012c, 57, 0, 1, 0x012d, 56, 0, 1, 0x012e, 1, 0, 1, 0x012f, 623 + 72, 0, 1, 0x0130, 59, 0, 1, 0x0131, 50, 0, 1, 240, 9, 0, 1, 240, 624 + 5, 0, 1, 241, 101, 0, 1, 0x0132, 13, 0, 20, 161, 1, 243, 1, 63, 625 + 48, 161, 11, 244, 1, 63, 9, 244, 1, 0x0133, 1, 0x0134, 1, 0x0135, 1, 162, 626 + 1, 244, 1, 162, 43, 244, 3, 0, 1, 164, 3, 0, 1, 164, 15, 0, 627 + 1, 63, 24, 0, 1, 164, 1, 0, 2, 164, 22, 0, 1, 0x0136, 1, 0, 628 + 1, 0x0137, 16, 0, 1, 63, 47, 0, 3, 0x0138, 3, 0, 1, 0x0138, 15, 0, 629 + 1, 63, 10, 0, 2, 0x0138, 3, 0, 1, 0x0138, 1, 0, 1, 0x0138, 1, 0, 630 + 1, 0x0138, 2, 0, 1, 0x0138, 1, 0, 4, 0x0138, 3, 0, 1, 0x0138, 1, 0, 631 + 1, 0x0138, 15, 0, 1, 245, 3, 0, 1, 245, 15, 0, 1, 63, 24, 0, 632 + 1, 245, 1, 0, 2, 245, 19, 0, 3, 0x0139, 3, 0, 1, 0x0139, 26, 0, 633 + 2, 0x0139, 3, 0, 1, 0x0139, 1, 0, 1, 0x0139, 1, 0, 1, 0x0139, 2, 0, 634 + 1, 0x0139, 1, 0, 4, 0x0139, 3, 0, 1, 0x0139, 1, 0, 1, 0x0139, 13, 0, 635 + 3, 0x013a, 3, 0, 1, 0x013a, 26, 0, 2, 0x013a, 3, 0, 1, 0x013a, 1, 0, 636 + 1, 0x013a, 1, 0, 1, 0x013a, 2, 0, 1, 0x013a, 1, 0, 4, 0x013a, 3, 0, 637 + 1, 0x013a, 1, 0, 1, 0x013a, 12, 0, 9, 181, 2, 89, 1, 90, 7, 181, 638 + 1, 89, 7, 181, 1, 0x013b, 51, 181, 2, 89, 1, 90, 7, 181, 1, 89, 639 + 15, 181, 1, 0x013c, 43, 181, 2, 89, 1, 90, 7, 181, 1, 89, 17, 181, 640 + 1, 0x013d, 32, 181, 1, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 641 + 7, 0, 14, 108, 1, 0x013e, 11, 108, 2, 0, 3, 108, 8, 0, 1, 108, 642 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 2, 108, 643 + 1, 0x013f, 23, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 644 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 6, 108, 1, 0x0140, 1, 0x0141, 645 + 18, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 646 + 3, 108, 8, 0, 4, 108, 7, 0, 10, 108, 1, 0x0142, 15, 108, 2, 0, 647 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 648 + 4, 108, 7, 0, 10, 108, 1, 0x0143, 15, 108, 2, 0, 3, 108, 8, 0, 649 + 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 650 + 5, 108, 1, 0x0144, 20, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 651 + 3, 108, 1, 0, 1, 108, 1, 0x0145, 1, 108, 8, 0, 4, 108, 7, 0, 652 + 26, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 653 + 3, 108, 8, 0, 4, 108, 7, 0, 5, 108, 1, 0x0146, 20, 108, 2, 0, 654 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 655 + 4, 108, 7, 0, 7, 108, 1, 0x0147, 18, 108, 2, 0, 3, 108, 8, 0, 656 + 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 657 + 10, 108, 1, 0x0148, 15, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 658 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 7, 108, 1, 0x0149, 659 + 18, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 660 + 3, 108, 8, 0, 4, 108, 6, 0, 1, 110, 2, 108, 1, 0x014a, 8, 108, 661 + 1, 0x014b, 2, 108, 1, 0x014c, 11, 108, 2, 0, 3, 108, 8, 0, 1, 108, 662 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 14, 108, 663 + 1, 0x014d, 11, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 664 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 10, 108, 1, 0x014e, 15, 108, 665 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 666 + 8, 0, 4, 108, 7, 0, 12, 108, 1, 0x014f, 13, 108, 2, 0, 3, 108, 667 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 668 + 7, 0, 5, 108, 1, 0x0150, 20, 108, 2, 0, 3, 108, 8, 0, 1, 108, 669 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 7, 108, 670 + 1, 0x0151, 18, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 671 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 7, 108, 1, 0x0152, 18, 108, 672 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 673 + 8, 0, 4, 108, 7, 0, 2, 108, 1, 0x0153, 23, 108, 2, 0, 3, 108, 674 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 675 + 7, 0, 18, 108, 1, 0x0154, 7, 108, 2, 0, 3, 108, 8, 0, 1, 108, 676 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 1, 108, 677 + 1, 0x0155, 24, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 678 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 2, 108, 1, 0x0156, 23, 108, 679 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 680 + 8, 0, 4, 108, 7, 0, 1, 108, 1, 0x0157, 24, 108, 2, 0, 3, 108, 681 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 682 + 7, 0, 13, 108, 1, 0x0158, 5, 108, 1, 0x0159, 6, 108, 2, 0, 3, 108, 683 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 684 + 7, 0, 4, 108, 1, 0x015a, 21, 108, 2, 0, 3, 108, 8, 0, 1, 108, 685 + 4, 0, 3, 108, 1, 0, 1, 108, 1, 0x015b, 1, 108, 8, 0, 4, 108, 686 + 7, 0, 26, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 687 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 13, 108, 1, 0x015c, 12, 108, 688 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 689 + 8, 0, 4, 108, 7, 0, 7, 108, 1, 0x015d, 18, 108, 2, 0, 3, 108, 690 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 691 + 7, 0, 8, 108, 1, 0x015e, 17, 108, 2, 0, 3, 108, 8, 0, 1, 108, 692 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 14, 108, 693 + 1, 0x015f, 11, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 694 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 10, 108, 1, 0x0160, 15, 108, 695 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 696 + 8, 0, 4, 108, 7, 0, 25, 108, 1, 0x0161, 2, 0, 3, 108, 8, 0, 697 + 1, 108, 4, 0, 3, 108, 1, 0, 1, 108, 1, 0x0162, 1, 108, 8, 0, 698 + 4, 108, 7, 0, 26, 108, 2, 0, 3, 108, 8, 0, 1, 108, 32, 0, 699 + 1, 0x0163, 69, 0, 1, 0x0164, 67, 0, 1, 0x0165, 43, 0, 3, 108, 1, 0, 700 + 3, 108, 8, 0, 4, 108, 7, 0, 12, 108, 1, 0x0166, 13, 108, 2, 0, 701 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 702 + 4, 108, 7, 0, 1, 108, 1, 0x0155, 1, 0x0167, 23, 108, 2, 0, 3, 108, 703 + 8, 0, 1, 108, 60, 0, 1, 0x0168, 13, 0, 3, 0x0169, 3, 0, 1, 0x0169, 704 + 26, 0, 2, 0x0169, 3, 0, 1, 0x0169, 1, 0, 1, 0x0169, 1, 0, 1, 0x0169, 705 + 2, 0, 1, 0x0169, 1, 0, 4, 0x0169, 3, 0, 1, 0x0169, 1, 0, 1, 0x0169, 706 + 57, 0, 1, 0x016a, 57, 0, 1, 0x016b, 65, 0, 1, 0x016c, 74, 0, 1, 0x016d, 707 + 82, 0, 1, 0x016e, 79, 0, 1, 0x016f, 12, 0, 11, 244, 1, 63, 8, 244, 708 + 1, 0x0170, 1, 162, 48, 244, 4, 0x0134, 1, 0x0171, 4, 0x0134, 2, 244, 1, 63, 709 + 7, 0x0134, 1, 244, 2, 0x0134, 1, 244, 47, 0x0134, 4, 0x0172, 1, 0x0173, 4, 0x0172, 710 + 2, 244, 1, 63, 7, 0x0172, 1, 244, 3, 0x0172, 1, 162, 46, 0x0172, 4, 0, 711 + 1, 0x0136, 1, 0, 1, 0x0137, 64, 0, 3, 0x0138, 3, 0, 1, 0x0138, 26, 0, 712 + 2, 0x0138, 3, 0, 1, 0x0138, 1, 0, 1, 0x0138, 1, 0, 1, 0x0138, 2, 0, 713 + 1, 0x0138, 1, 0, 4, 0x0138, 3, 0, 1, 0x0138, 1, 0, 1, 0x0138, 13, 0, 714 + 3, 0x0174, 3, 0, 1, 0x0174, 26, 0, 2, 0x0174, 3, 0, 1, 0x0174, 1, 0, 715 + 1, 0x0174, 1, 0, 1, 0x0174, 2, 0, 1, 0x0174, 1, 0, 4, 0x0174, 3, 0, 716 + 1, 0x0174, 1, 0, 1, 0x0174, 13, 0, 3, 0x0175, 3, 0, 1, 0x0175, 26, 0, 717 + 2, 0x0175, 3, 0, 1, 0x0175, 1, 0, 1, 0x0175, 1, 0, 1, 0x0175, 2, 0, 718 + 1, 0x0175, 1, 0, 4, 0x0175, 3, 0, 1, 0x0175, 1, 0, 1, 0x0175, 12, 0, 719 + 9, 181, 2, 89, 1, 90, 7, 181, 1, 89, 9, 181, 1, 0x0176, 49, 181, 720 + 2, 89, 1, 90, 7, 181, 1, 89, 4, 181, 1, 0x0177, 4, 181, 1, 0x0178, 721 + 8, 181, 1, 0x0179, 40, 181, 2, 89, 1, 90, 7, 181, 1, 89, 14, 181, 722 + 1, 0x017a, 35, 181, 1, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 723 + 7, 0, 5, 108, 1, 0x017b, 20, 108, 2, 0, 3, 108, 8, 0, 1, 108, 724 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 6, 0, 1, 110, 725 + 2, 108, 1, 0x017c, 23, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 726 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 4, 108, 1, 0x017d, 727 + 21, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 728 + 3, 108, 8, 0, 4, 108, 7, 0, 20, 108, 1, 0x017e, 5, 108, 2, 0, 729 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 1, 108, 1, 0x017f, 730 + 1, 108, 8, 0, 4, 108, 7, 0, 26, 108, 2, 0, 3, 108, 8, 0, 731 + 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 732 + 7, 108, 1, 0x0180, 18, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 733 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 4, 108, 1, 0x0181, 734 + 21, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 735 + 3, 108, 8, 0, 4, 108, 7, 0, 1, 108, 1, 0x0182, 24, 108, 2, 0, 736 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 737 + 4, 108, 7, 0, 6, 108, 1, 0x0183, 19, 108, 2, 0, 3, 108, 8, 0, 738 + 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 1, 0x0184, 7, 0, 2, 108, 739 + 1, 0x0185, 1, 108, 7, 0, 26, 108, 2, 0, 3, 108, 8, 0, 1, 108, 740 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 7, 108, 741 + 1, 0x0186, 18, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 742 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 1, 108, 1, 0x0187, 24, 108, 743 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 744 + 8, 0, 4, 108, 7, 0, 3, 108, 1, 0x0188, 22, 108, 2, 0, 3, 108, 745 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 746 + 7, 0, 12, 108, 1, 0x0189, 13, 108, 2, 0, 3, 108, 8, 0, 1, 108, 747 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 10, 108, 748 + 1, 0x018a, 15, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 749 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 2, 108, 1, 0x018b, 23, 108, 750 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 751 + 8, 0, 4, 108, 7, 0, 10, 108, 1, 0x018c, 15, 108, 2, 0, 3, 108, 752 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 753 + 7, 0, 8, 108, 1, 0x018d, 17, 108, 2, 0, 3, 108, 8, 0, 1, 108, 754 + 4, 0, 3, 108, 1, 0, 1, 0x018e, 2, 108, 8, 0, 4, 108, 7, 0, 755 + 26, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 756 + 3, 108, 8, 0, 4, 108, 7, 0, 4, 108, 1, 0x018f, 21, 108, 2, 0, 757 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 758 + 4, 108, 7, 0, 4, 108, 1, 0x0190, 21, 108, 2, 0, 3, 108, 8, 0, 759 + 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 760 + 19, 108, 1, 0x0191, 6, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 761 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 14, 108, 1, 0x0192, 762 + 11, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 763 + 3, 108, 8, 0, 4, 108, 7, 0, 7, 108, 1, 0x0193, 18, 108, 2, 0, 764 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 765 + 4, 108, 7, 0, 9, 108, 1, 0x0194, 16, 108, 2, 0, 3, 108, 8, 0, 766 + 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 767 + 7, 108, 1, 0x0195, 18, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 768 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 15, 108, 1, 0x0196, 769 + 10, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 770 + 3, 108, 8, 0, 4, 108, 7, 0, 13, 108, 1, 0x0197, 12, 108, 2, 0, 771 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 772 + 4, 108, 7, 0, 10, 108, 1, 0x0198, 15, 108, 2, 0, 3, 108, 8, 0, 773 + 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 774 + 7, 108, 1, 0x0199, 18, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 775 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 14, 108, 1, 0x019a, 776 + 11, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 777 + 3, 108, 8, 0, 4, 108, 7, 0, 1, 0x019b, 25, 108, 2, 0, 3, 108, 778 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 779 + 7, 0, 20, 108, 1, 0x019c, 5, 108, 2, 0, 3, 108, 8, 0, 1, 108, 780 + 32, 0, 1, 0x019d, 41, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 781 + 7, 0, 2, 108, 1, 0x019e, 23, 108, 2, 0, 3, 108, 8, 0, 1, 108, 782 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 7, 108, 783 + 1, 0x019f, 18, 108, 2, 0, 3, 108, 8, 0, 1, 108, 61, 0, 1, 0x01a0, 784 + 12, 0, 3, 0x01a1, 3, 0, 1, 0x01a1, 26, 0, 2, 0x01a1, 3, 0, 1, 0x01a1, 785 + 1, 0, 1, 0x01a1, 1, 0, 1, 0x01a1, 2, 0, 1, 0x01a1, 1, 0, 4, 0x01a1, 786 + 3, 0, 1, 0x01a1, 1, 0, 1, 0x01a1, 46, 0, 1, 0x01a2, 69, 0, 1, 0x01a3, 787 + 64, 0, 1, 0x01a4, 69, 0, 1, 0x01a5, 67, 0, 1, 0x01a6, 100, 0, 1, 0x01a7, 788 + 11, 0, 9, 0x0170, 2, 0x01a8, 1, 0x01a9, 7, 0x0170, 1, 0x01a8, 1, 0x01aa, 49, 0x0170, 789 + 9, 0x0134, 2, 244, 1, 63, 7, 0x0134, 1, 244, 50, 0x0134, 9, 162, 2, 244, 790 + 1, 63, 7, 162, 1, 244, 3, 162, 1, 244, 46, 162, 3, 0x0172, 1, 0x01ab, 791 + 1, 0x01ac, 1, 0x0172, 1, 0x01ad, 1, 0x01ae, 1, 0x0172, 2, 244, 1, 63, 7, 0x0172, 792 + 1, 244, 28, 0x0172, 1, 0x01ab, 1, 0x0172, 1, 0x01ae, 1, 0x01ab, 18, 0x0172, 1, 0, 793 + 3, 0x01af, 3, 0, 1, 0x01af, 26, 0, 2, 0x01af, 3, 0, 1, 0x01af, 1, 0, 794 + 1, 0x01af, 1, 0, 1, 0x01af, 2, 0, 1, 0x01af, 1, 0, 4, 0x01af, 3, 0, 795 + 1, 0x01af, 1, 0, 1, 0x01af, 13, 0, 3, 0x01b0, 3, 0, 1, 0x01b0, 26, 0, 796 + 2, 0x01b0, 3, 0, 1, 0x01b0, 1, 0, 1, 0x01b0, 1, 0, 1, 0x01b0, 2, 0, 797 + 1, 0x01b0, 1, 0, 4, 0x01b0, 3, 0, 1, 0x01b0, 1, 0, 1, 0x01b0, 12, 0, 798 + 9, 181, 2, 89, 1, 90, 7, 181, 1, 89, 4, 181, 1, 0x01b1, 4, 181, 799 + 1, 0x01b2, 40, 181, 9, 0x0177, 2, 0x01b3, 1, 0x01b4, 7, 0x0177, 1, 0x01b3, 50, 0x0177, 800 + 9, 181, 2, 89, 1, 90, 7, 181, 1, 89, 10, 181, 1, 0x01b5, 48, 181, 801 + 2, 89, 1, 90, 7, 181, 1, 89, 19, 181, 1, 0x01b6, 35, 181, 1, 0x01b7, 802 + 3, 181, 2, 89, 1, 90, 7, 181, 1, 89, 50, 181, 1, 0, 3, 108, 803 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 19, 108, 1, 0x01b8, 6, 108, 804 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 805 + 8, 0, 4, 108, 7, 0, 3, 108, 1, 0x01b9, 22, 108, 2, 0, 3, 108, 806 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 807 + 7, 0, 12, 108, 1, 0x01ba, 13, 108, 2, 0, 3, 108, 8, 0, 1, 108, 808 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 7, 108, 809 + 1, 0x01bb, 18, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 810 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 19, 108, 1, 0x01bc, 6, 108, 811 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 812 + 8, 0, 4, 108, 7, 0, 15, 108, 1, 0x01bd, 10, 108, 2, 0, 3, 108, 813 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 814 + 7, 0, 7, 108, 1, 0x01be, 18, 108, 2, 0, 3, 108, 8, 0, 1, 108, 815 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 1, 0x01bf, 816 + 25, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 817 + 3, 108, 8, 0, 4, 108, 7, 0, 13, 108, 1, 0x01c0, 12, 108, 2, 0, 818 + 3, 108, 8, 0, 1, 108, 5, 0, 1, 0x01c1, 2, 0, 2, 0x01c1, 1, 0, 819 + 1, 0x0184, 7, 0, 1, 0x01c1, 1, 0, 1, 0x0184, 8, 0, 21, 0x01c1, 4, 0, 820 + 1, 0x01c1, 2, 0, 3, 0x01c1, 8, 0, 1, 0x01c1, 4, 0, 1, 108, 1, 0x01c1, 821 + 1, 108, 1, 0, 2, 0x01c1, 1, 108, 1, 0x0184, 7, 0, 1, 0x01c1, 1, 108, 822 + 1, 0x0185, 1, 108, 7, 0, 21, 0x01c1, 4, 108, 1, 0x01c1, 2, 0, 3, 0x01c1, 823 + 8, 0, 1, 0x01c1, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 824 + 7, 0, 19, 108, 1, 0x01c2, 6, 108, 2, 0, 3, 108, 8, 0, 1, 108, 825 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 4, 108, 826 + 1, 0x01c3, 21, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 827 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 10, 108, 1, 0x01c4, 15, 108, 828 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 829 + 8, 0, 4, 108, 7, 0, 5, 108, 1, 0x01c5, 20, 108, 2, 0, 3, 108, 830 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 831 + 7, 0, 1, 0x01c6, 25, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 832 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 2, 108, 1, 0x01c7, 833 + 23, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 834 + 3, 108, 8, 0, 4, 108, 7, 0, 12, 108, 1, 0x01c8, 13, 108, 2, 0, 835 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 836 + 4, 108, 7, 0, 1, 0x01c9, 25, 108, 2, 0, 3, 108, 8, 0, 1, 108, 837 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 12, 108, 838 + 1, 0x01ca, 13, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 839 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 3, 108, 1, 0x01cb, 22, 108, 840 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 841 + 8, 0, 4, 108, 7, 0, 4, 108, 1, 0x01cc, 21, 108, 2, 0, 3, 108, 842 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 843 + 7, 0, 15, 108, 1, 0x01cd, 10, 108, 2, 0, 3, 108, 8, 0, 1, 108, 844 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 16, 108, 845 + 1, 0x01ce, 9, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 846 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 1, 108, 1, 0x01cf, 24, 108, 847 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 848 + 1, 0x01d0, 7, 0, 2, 108, 1, 0x01d1, 1, 108, 7, 0, 26, 108, 2, 0, 849 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 850 + 4, 108, 7, 0, 7, 108, 1, 0x01d2, 18, 108, 2, 0, 3, 108, 8, 0, 851 + 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 852 + 4, 108, 1, 0x01d3, 21, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 853 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 17, 108, 1, 0x01d4, 854 + 8, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 855 + 3, 108, 8, 0, 4, 108, 7, 0, 14, 108, 1, 0x01d5, 11, 108, 2, 0, 856 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 857 + 4, 108, 7, 0, 7, 108, 1, 0x01d6, 18, 108, 2, 0, 3, 108, 8, 0, 858 + 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 1, 228, 7, 0, 2, 108, 859 + 1, 229, 1, 108, 7, 0, 13, 108, 1, 0x01d7, 12, 108, 2, 0, 3, 108, 860 + 8, 0, 1, 108, 61, 0, 1, 0x01d8, 42, 0, 1, 0x01d9, 69, 0, 1, 0x01da, 861 + 72, 0, 1, 0x01db, 64, 0, 1, 0x01dc, 69, 0, 1, 0x01dd, 98, 0, 1, 0x01de, 862 + 11, 0, 11, 0x01a8, 1, 0x01a9, 8, 0x01a8, 1, 0x01df, 1, 0x01e0, 1, 0x01e1, 1, 0x01e2, 863 + 1, 0x0170, 1, 0x01a8, 1, 0x0170, 43, 0x01a8, 20, 0x01a9, 1, 0x01e3, 1, 0x01e4, 1, 0x01e5, 864 + 1, 0x01e6, 1, 161, 1, 0x01a9, 1, 161, 43, 0x01a9, 9, 0x0170, 2, 0x01a8, 1, 0x01a9, 865 + 7, 0x0170, 1, 0x01a8, 1, 0x01aa, 1, 244, 48, 0x0170, 3, 162, 1, 0x0172, 3, 162, 866 + 1, 0x0172, 1, 162, 2, 244, 1, 63, 7, 162, 1, 244, 3, 162, 1, 244, 867 + 24, 162, 1, 0x0172, 1, 162, 2, 0x0172, 22, 162, 1, 0x01e7, 1, 162, 1, 0x01e8, 868 + 2, 162, 2, 244, 1, 63, 7, 162, 1, 244, 3, 162, 1, 244, 47, 162, 869 + 3, 0x01e9, 3, 162, 1, 0x01e9, 1, 162, 2, 244, 1, 63, 7, 162, 1, 244, 870 + 3, 162, 1, 244, 10, 162, 2, 0x01e9, 3, 162, 1, 0x01e9, 1, 162, 1, 0x01e9, 871 + 1, 162, 1, 0x01e9, 2, 162, 1, 0x01e9, 1, 162, 4, 0x01e9, 3, 162, 1, 0x01e9, 872 + 1, 162, 1, 0x01e9, 15, 162, 1, 0x01ab, 3, 162, 1, 0x01ab, 1, 162, 2, 244, 873 + 1, 63, 7, 162, 1, 244, 3, 162, 1, 244, 24, 162, 1, 0x01ab, 1, 162, 874 + 2, 0x01ab, 18, 162, 1, 0, 3, 164, 3, 0, 1, 164, 26, 0, 2, 164, 875 + 3, 0, 1, 164, 1, 0, 1, 164, 1, 0, 1, 164, 2, 0, 1, 164, 876 + 1, 0, 4, 164, 3, 0, 1, 164, 1, 0, 1, 164, 12, 0, 9, 0x01b1, 877 + 2, 0x01ea, 1, 0x01eb, 7, 0x01b1, 1, 0x01ea, 50, 0x01b1, 9, 181, 2, 89, 1, 90, 878 + 7, 181, 1, 89, 10, 181, 1, 0x01ec, 48, 181, 2, 89, 1, 90, 7, 181, 879 + 1, 89, 11, 181, 1, 0x01ed, 47, 181, 2, 89, 1, 90, 7, 181, 1, 89, 880 + 17, 181, 1, 0x01ee, 41, 181, 2, 89, 1, 90, 7, 181, 1, 89, 9, 181, 881 + 1, 0x01ef, 40, 181, 1, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 882 + 7, 0, 7, 108, 1, 0x01f0, 18, 108, 2, 0, 3, 108, 8, 0, 1, 108, 883 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 4, 108, 884 + 1, 0x01f1, 21, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 885 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 18, 108, 1, 0x01f2, 7, 108, 886 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 887 + 8, 0, 4, 108, 7, 0, 4, 108, 1, 0x01f3, 21, 108, 2, 0, 3, 108, 888 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 889 + 7, 0, 7, 108, 1, 0x01f4, 18, 108, 2, 0, 3, 108, 8, 0, 1, 108, 890 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 7, 108, 891 + 1, 0x01f5, 18, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 892 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 14, 108, 1, 0x01f6, 11, 108, 893 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 1, 0x01f7, 894 + 2, 108, 8, 0, 4, 108, 7, 0, 26, 108, 2, 0, 3, 108, 8, 0, 895 + 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 1, 0x01f8, 7, 0, 2, 108, 896 + 1, 0x01f9, 1, 108, 7, 0, 26, 108, 2, 0, 3, 108, 8, 0, 1, 108, 897 + 4, 0, 3, 0x01c1, 1, 0, 3, 0x01c1, 1, 0x01fa, 3, 0, 1, 0x0184, 1, 0, 898 + 1, 0x01fb, 1, 0, 4, 0x01c1, 7, 0, 26, 0x01c1, 2, 0, 3, 0x01c1, 8, 0, 899 + 1, 0x01c1, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 900 + 13, 108, 1, 0x01fc, 12, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 901 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 5, 108, 1, 0x01fd, 902 + 20, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 903 + 3, 108, 8, 0, 4, 108, 6, 0, 1, 110, 26, 108, 2, 0, 3, 108, 904 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 905 + 7, 0, 13, 108, 1, 0x01fe, 12, 108, 2, 0, 3, 108, 8, 0, 1, 108, 906 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 5, 108, 907 + 1, 0x01ff, 20, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 908 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 3, 108, 1, 0x0200, 22, 108, 909 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 910 + 8, 0, 4, 108, 7, 0, 14, 108, 1, 0x0201, 11, 108, 2, 0, 3, 108, 911 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 912 + 7, 0, 11, 108, 1, 0x0202, 14, 108, 2, 0, 3, 108, 8, 0, 1, 108, 913 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 10, 108, 914 + 1, 0x0203, 15, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 915 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 4, 108, 1, 0x0204, 21, 108, 916 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 917 + 1, 0x0205, 7, 0, 2, 108, 1, 0x0206, 1, 108, 7, 0, 26, 108, 2, 0, 918 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 1, 108, 1, 0x0207, 919 + 1, 108, 8, 0, 4, 108, 7, 0, 26, 108, 2, 0, 3, 108, 8, 0, 920 + 1, 108, 5, 0, 1, 0x0208, 2, 0, 2, 0x0208, 1, 0, 1, 0x01d0, 7, 0, 921 + 1, 0x0208, 1, 0, 1, 0x01d0, 8, 0, 21, 0x0208, 4, 0, 1, 0x0208, 2, 0, 922 + 3, 0x0208, 8, 0, 1, 0x0208, 4, 0, 1, 108, 1, 0x0208, 1, 108, 1, 0, 923 + 2, 0x0208, 1, 108, 1, 0x01d0, 7, 0, 1, 0x0208, 1, 108, 1, 0x01d1, 1, 108, 924 + 7, 0, 21, 0x0208, 4, 108, 1, 0x0208, 2, 0, 3, 0x0208, 8, 0, 1, 0x0208, 925 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 13, 108, 926 + 1, 0x0209, 12, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 927 + 1, 0, 3, 108, 1, 0x020a, 7, 0, 2, 108, 1, 0x020b, 1, 108, 7, 0, 928 + 26, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 929 + 3, 108, 1, 225, 7, 0, 2, 108, 1, 226, 1, 108, 7, 0, 13, 108, 930 + 1, 0x020c, 12, 108, 2, 0, 3, 108, 8, 0, 1, 108, 11, 0, 4, 0x01d8, 931 + 6, 0, 2, 0x01d8, 6, 0, 1, 0x020d, 84, 0, 1, 0x020e, 69, 0, 1, 0x020f, 932 + 59, 0, 1, 0x0210, 72, 0, 1, 0x0211, 103, 0, 1, 0x0212, 9, 0, 4, 0x0213, 933 + 6, 0, 2, 0x0213, 50, 0, 11, 0x01a8, 1, 0x01a9, 8, 0x01a8, 1, 0x01df, 1, 0x0214, 934 + 1, 0x01e1, 1, 0x01e2, 1, 0x0170, 1, 0x01a8, 1, 0x0170, 54, 0x01a8, 1, 0x01a9, 8, 0x01a8, 935 + 1, 0x0215, 1, 0x0170, 48, 0x01a8, 4, 0x01e1, 1, 0x0216, 4, 0x01e1, 2, 0x01a8, 1, 0x01a9, 936 + 7, 0x01e1, 1, 0x01a8, 1, 0x0217, 1, 0x01e1, 1, 0x01a8, 47, 0x01e1, 4, 0x0218, 1, 0x0219, 937 + 4, 0x0218, 2, 0x01a8, 1, 0x01a9, 7, 0x0218, 1, 0x01a8, 1, 0x021a, 2, 0x0218, 1, 0x0170, 938 + 46, 0x0218, 20, 0x01a9, 1, 0x01e3, 1, 0x021b, 1, 0x01e5, 1, 0x01e6, 1, 161, 1, 0x01a9, 939 + 1, 161, 63, 0x01a9, 1, 0x021c, 1, 0x0170, 48, 0x01a9, 4, 0x01e5, 1, 0x021d, 4, 0x01e5, 940 + 3, 161, 7, 0x01e5, 1, 161, 1, 0x021e, 1, 0x01e5, 1, 0x01a9, 47, 0x01e5, 4, 0x021f, 941 + 1, 0x0220, 4, 0x021f, 3, 161, 7, 0x021f, 1, 161, 1, 0x0221, 2, 0x021f, 1, 161, 942 + 46, 0x021f, 4, 162, 1, 0x01e7, 1, 162, 1, 0x01e8, 2, 162, 2, 244, 1, 63, 943 + 7, 162, 1, 244, 51, 162, 3, 0x01e9, 3, 162, 1, 0x01e9, 1, 162, 2, 244, 944 + 1, 63, 7, 162, 1, 244, 14, 162, 2, 0x01e9, 3, 162, 1, 0x01e9, 1, 162, 945 + 1, 0x01e9, 1, 162, 1, 0x01e9, 2, 162, 1, 0x01e9, 1, 162, 4, 0x01e9, 3, 162, 946 + 1, 0x01e9, 1, 162, 1, 0x01e9, 13, 162, 3, 0x0222, 3, 162, 1, 0x0222, 1, 162, 947 + 2, 244, 1, 63, 7, 162, 1, 244, 14, 162, 2, 0x0222, 3, 162, 1, 0x0222, 948 + 1, 162, 1, 0x0222, 1, 162, 1, 0x0222, 2, 162, 1, 0x0222, 1, 162, 4, 0x0222, 949 + 3, 162, 1, 0x0222, 1, 162, 1, 0x0222, 12, 162, 9, 181, 2, 89, 1, 90, 950 + 7, 181, 1, 89, 11, 181, 1, 0x0223, 47, 181, 2, 89, 1, 90, 7, 181, 951 + 1, 89, 12, 181, 1, 0x0224, 46, 181, 2, 89, 1, 90, 7, 181, 1, 89, 952 + 4, 181, 1, 0x0225, 54, 181, 2, 89, 1, 90, 7, 181, 1, 89, 10, 181, 953 + 1, 0x0226, 39, 181, 1, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 954 + 7, 0, 5, 108, 1, 0x0227, 20, 108, 2, 0, 3, 108, 8, 0, 1, 108, 955 + 4, 0, 3, 108, 1, 0, 3, 108, 1, 0x0228, 7, 0, 2, 108, 1, 0x0228, 956 + 1, 108, 7, 0, 26, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 957 + 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 1, 108, 1, 0x0229, 958 + 24, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 959 + 3, 108, 8, 0, 4, 108, 7, 0, 12, 108, 1, 0x022a, 13, 108, 2, 0, 960 + 3, 108, 8, 0, 1, 108, 3, 0, 2, 0x022b, 1, 0x022c, 2, 0x022b, 2, 0x022c, 961 + 1, 0x022b, 1, 0x01f8, 3, 0, 4, 0x022b, 1, 0x022c, 1, 0x022b, 1, 0x01f8, 1, 0, 962 + 7, 0x022b, 21, 0x022c, 4, 0x022b, 1, 0x022c, 2, 0x022b, 3, 0x022c, 8, 0x022b, 1, 0x022c, 963 + 4, 0x022b, 1, 0x022d, 1, 0x022c, 1, 0x022d, 1, 0x022b, 2, 0x022c, 1, 0x022d, 1, 0x01f8, 964 + 3, 0, 4, 0x022b, 1, 0x022c, 1, 0x022d, 1, 0x01f9, 1, 108, 7, 0x022b, 21, 0x022c, 965 + 4, 0x022d, 1, 0x022c, 2, 0x022b, 3, 0x022c, 8, 0x022b, 1, 0x022c, 3, 0x022b, 8, 0, 966 + 1, 0x01fa, 3, 0, 1, 0x0184, 1, 0, 1, 0x01fb, 3, 0, 1, 0x01fa, 59, 0, 967 + 1, 0x01fb, 6, 0, 1, 0x022e, 2, 0, 1, 0x01fb, 52, 0, 3, 108, 1, 0, 968 + 3, 108, 1, 0x022f, 7, 0, 2, 108, 1, 0x0230, 1, 108, 7, 0, 26, 108, 969 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 970 + 8, 0, 4, 108, 7, 0, 6, 108, 1, 0x0231, 19, 108, 2, 0, 3, 108, 971 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 972 + 7, 0, 7, 108, 1, 0x0232, 18, 108, 2, 0, 3, 108, 8, 0, 1, 108, 973 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 1, 108, 974 + 1, 0x0233, 24, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 975 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 4, 108, 1, 0x0234, 21, 108, 976 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 977 + 8, 0, 4, 108, 7, 0, 2, 108, 1, 0x0235, 23, 108, 2, 0, 3, 108, 978 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 979 + 7, 0, 12, 108, 1, 0x0236, 13, 108, 2, 0, 3, 108, 8, 0, 1, 108, 980 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 5, 108, 981 + 1, 0x0237, 20, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 982 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 5, 108, 1, 0x0238, 20, 108, 983 + 2, 0, 3, 108, 8, 0, 1, 108, 3, 0, 2, 0x0239, 1, 0x023a, 2, 0x0239, 984 + 2, 0x023a, 1, 0x0239, 1, 0x0205, 3, 0, 4, 0x0239, 1, 0x023a, 1, 0x0239, 1, 0x0205, 985 + 1, 0, 7, 0x0239, 21, 0x023a, 4, 0x0239, 1, 0x023a, 2, 0x0239, 3, 0x023a, 8, 0x0239, 986 + 1, 0x023a, 4, 0x0239, 1, 0x023b, 1, 0x023a, 1, 0x023b, 1, 0x0239, 2, 0x023a, 1, 0x023b, 987 + 1, 0x0205, 3, 0, 4, 0x0239, 1, 0x023a, 1, 0x023b, 1, 0x0206, 1, 108, 7, 0x0239, 988 + 21, 0x023a, 4, 0x023b, 1, 0x023a, 2, 0x0239, 3, 0x023a, 8, 0x0239, 1, 0x023a, 3, 0x0239, 989 + 1, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 20, 108, 990 + 1, 0x023c, 5, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 0x0208, 991 + 1, 0, 3, 0x0208, 1, 0x023d, 7, 0, 4, 0x0208, 7, 0, 26, 0x0208, 2, 0, 992 + 3, 0x0208, 8, 0, 1, 0x0208, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 993 + 4, 108, 7, 0, 13, 108, 1, 0x023e, 12, 108, 2, 0, 3, 108, 8, 0, 994 + 1, 108, 3, 0, 1, 0x023f, 1, 0x0240, 1, 0x023f, 1, 0x0240, 3, 0x023f, 1, 0x0240, 995 + 1, 0x020a, 3, 0, 6, 0x023f, 1, 0x020a, 1, 0, 28, 0x023f, 4, 0x0240, 19, 0x023f, 996 + 1, 0x0241, 1, 0x0242, 1, 0x0241, 1, 0x023f, 2, 0x0242, 1, 0x0241, 1, 0x020a, 3, 0, 997 + 4, 0x023f, 2, 0x0242, 1, 0x020b, 1, 108, 7, 0x023f, 21, 0x0242, 4, 0x0241, 1, 0x0242, 998 + 2, 0x023f, 3, 0x0242, 8, 0x023f, 1, 0x0242, 3, 0x023f, 39, 0, 1, 0x0243, 69, 0, 999 + 1, 0x0244, 98, 0, 1, 0x0245, 32, 0, 1, 0x0246, 53, 0, 1, 0x0247, 62, 0, 1000 + 4, 0x0213, 6, 0, 2, 0x0213, 6, 0, 1, 0x0248, 43, 0, 11, 244, 1, 63, 1001 + 8, 244, 1, 0x01a8, 1, 0x0133, 1, 0x0249, 1, 0x024a, 46, 244, 9, 0x0170, 2, 0x01a8, 1002 + 1, 0x01a9, 7, 0x0170, 1, 0x01a8, 1, 0x01aa, 1, 0x01a8, 48, 0x0170, 9, 0x01e1, 2, 0x01a8, 1003 + 1, 0x01a9, 7, 0x01e1, 1, 0x01a8, 1, 0x0217, 53, 0x01e1, 1, 0x0216, 4, 0x01e1, 2, 0x01a8, 1004 + 1, 0x01a9, 7, 0x01e1, 1, 0x01a8, 1, 0x0217, 1, 0x0249, 1, 0x01a8, 47, 0x01e1, 9, 0x0170, 1005 + 2, 0x01a8, 1, 0x01a9, 7, 0x0170, 1, 0x01a8, 1, 0x01aa, 2, 0x0170, 1, 0x01a8, 46, 0x0170, 1006 + 3, 0x0218, 1, 0x024b, 1, 0x024c, 1, 0x0218, 1, 0x024d, 1, 0x024e, 1, 0x0218, 2, 0x01a8, 1007 + 1, 0x01a9, 7, 0x0218, 1, 0x01a8, 1, 0x021a, 27, 0x0218, 1, 0x024b, 1, 0x0218, 1, 0x024e, 1008 + 1, 0x024b, 18, 0x0218, 9, 0x0170, 2, 0x01a8, 1, 0x01a9, 7, 0x0170, 1, 0x01a8, 1, 0x01aa, 1009 + 1, 244, 1, 0x0170, 1, 0x01a8, 46, 0x0170, 20, 63, 1, 0x01a9, 1, 0x0133, 1, 0x024f, 1010 + 1, 0x0250, 46, 63, 20, 161, 1, 243, 1, 0x01a9, 48, 161, 9, 0x01e5, 3, 161, 1011 + 7, 0x01e5, 1, 161, 1, 0x021e, 53, 0x01e5, 1, 0x021d, 4, 0x01e5, 3, 161, 7, 0x01e5, 1012 + 1, 161, 1, 0x021e, 1, 0x024f, 1, 0x01a9, 47, 0x01e5, 20, 161, 1, 243, 2, 161, 1013 + 1, 0x01a9, 46, 161, 3, 0x021f, 1, 0x0251, 1, 0x0252, 1, 0x021f, 1, 0x0253, 1, 0x0254, 1014 + 1, 0x021f, 3, 161, 7, 0x021f, 1, 161, 1, 0x0221, 27, 0x021f, 1, 0x0251, 1, 0x021f, 1015 + 1, 0x0254, 1, 0x0251, 18, 0x021f, 20, 161, 1, 243, 1, 63, 1, 161, 1, 0x01a9, 1016 + 46, 161, 1, 162, 3, 0x0255, 3, 162, 1, 0x0255, 1, 162, 2, 244, 1, 63, 1017 + 7, 162, 1, 244, 14, 162, 2, 0x0255, 3, 162, 1, 0x0255, 1, 162, 1, 0x0255, 1018 + 1, 162, 1, 0x0255, 2, 162, 1, 0x0255, 1, 162, 4, 0x0255, 3, 162, 1, 0x0255, 1019 + 1, 162, 1, 0x0255, 12, 162, 9, 181, 2, 89, 1, 90, 7, 181, 1, 89, 1020 + 12, 181, 1, 0x0256, 46, 181, 2, 89, 1, 90, 7, 181, 1, 89, 13, 181, 1021 + 1, 0x0257, 36, 181, 9, 0x0225, 2, 0x0258, 1, 0x0259, 7, 0x0225, 1, 0x0258, 50, 0x0225, 1022 + 9, 181, 2, 89, 1, 90, 7, 181, 1, 89, 11, 181, 1, 0x025a, 38, 181, 1023 + 1, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 6, 108, 1024 + 1, 0x025b, 19, 108, 2, 0, 3, 108, 8, 0, 1, 108, 3, 0, 11, 0x0228, 1025 + 1, 0, 58, 0x0228, 1, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 1026 + 7, 0, 2, 108, 1, 0x025c, 23, 108, 2, 0, 3, 108, 8, 0, 1, 108, 1027 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 13, 108, 1028 + 1, 0x025d, 12, 108, 2, 0, 3, 108, 8, 0, 1, 108, 3, 0, 9, 0x022b, 1029 + 3, 0, 7, 0x022b, 1, 0, 51, 0x022b, 3, 0x022c, 1, 0x022b, 3, 0x022c, 1, 0x025e, 1030 + 3, 0, 2, 0x01f8, 2, 0x022b, 3, 0x022c, 1, 0x025f, 7, 0x022b, 26, 0x022c, 2, 0x022b, 1031 + 3, 0x022c, 8, 0x022b, 1, 0x022c, 4, 0x022b, 3, 0x022d, 1, 0x022b, 3, 0x022d, 1, 0x022b, 1032 + 3, 0, 4, 0x022b, 3, 0x022d, 1, 108, 7, 0x022b, 26, 0x022d, 2, 0x022b, 3, 0x022d, 1033 + 8, 0x022b, 1, 0x022d, 3, 0x022b, 8, 0, 1, 0x022e, 5, 0, 1, 0x01fb, 3, 0, 1034 + 1, 0x022e, 53, 0, 1, 0x0260, 2, 0, 2, 0x0260, 1, 0, 1, 0x022f, 7, 0, 1035 + 1, 0x0260, 1, 0, 1, 0x022f, 8, 0, 21, 0x0260, 4, 0, 1, 0x0260, 2, 0, 1036 + 3, 0x0260, 8, 0, 1, 0x0260, 4, 0, 1, 108, 1, 0x0260, 1, 108, 1, 0, 1037 + 2, 0x0260, 1, 108, 1, 0x022f, 7, 0, 1, 0x0260, 1, 108, 1, 0x0230, 1, 108, 1038 + 7, 0, 21, 0x0260, 4, 108, 1, 0x0260, 2, 0, 3, 0x0260, 8, 0, 1, 0x0260, 1039 + 4, 0, 3, 108, 1, 0, 3, 108, 1, 0x0261, 7, 0, 2, 108, 1, 0x0262, 1040 + 1, 108, 6, 0, 1, 110, 26, 108, 2, 0, 3, 108, 8, 0, 1, 108, 1041 + 4, 0, 3, 108, 1, 0, 3, 108, 1, 0x0263, 7, 0, 2, 108, 1, 0x0264, 1042 + 1, 108, 7, 0, 26, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 1043 + 3, 108, 1, 0, 3, 108, 1, 0x0265, 7, 0, 2, 108, 1, 0x0266, 1, 108, 1044 + 7, 0, 26, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1045 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 5, 108, 1, 0x0267, 20, 108, 1046 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 1047 + 8, 0, 4, 108, 7, 0, 2, 108, 1, 0x0268, 23, 108, 2, 0, 3, 108, 1048 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 1049 + 7, 0, 1, 108, 1, 0x0269, 24, 108, 2, 0, 3, 108, 8, 0, 1, 108, 1050 + 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 4, 108, 1051 + 1, 0x026a, 21, 108, 2, 0, 3, 108, 8, 0, 1, 108, 3, 0, 9, 0x0239, 1052 + 3, 0, 7, 0x0239, 1, 0, 51, 0x0239, 3, 0x023a, 1, 0x0239, 3, 0x023a, 1, 0x026b, 1053 + 3, 0, 1, 0x0205, 3, 0x0239, 3, 0x023a, 1, 0x026c, 7, 0x0239, 26, 0x023a, 2, 0x0239, 1054 + 3, 0x023a, 8, 0x0239, 1, 0x023a, 4, 0x0239, 3, 0x023b, 1, 0x0239, 3, 0x023b, 1, 0x0239, 1055 + 3, 0, 4, 0x0239, 3, 0x023b, 1, 108, 7, 0x0239, 26, 0x023b, 2, 0x0239, 3, 0x023b, 1056 + 8, 0x0239, 1, 0x023b, 3, 0x0239, 8, 0, 1, 0x023d, 9, 0, 1, 0x023d, 51, 0, 1057 + 9, 0x023f, 3, 0, 7, 0x023f, 1, 0, 51, 0x023f, 1, 0x0240, 1, 0x023f, 1, 0x0240, 1058 + 3, 0x023f, 1, 0x0240, 1, 0x026d, 3, 0, 6, 0x023f, 1, 0x026d, 1, 0, 28, 0x023f, 1059 + 4, 0x0240, 19, 0x023f, 1, 0x0241, 1, 0x0242, 1, 0x0241, 1, 0x023f, 2, 0x0242, 1, 0x0241, 1060 + 1, 0x026d, 3, 0, 4, 0x023f, 2, 0x0242, 1, 0x026e, 1, 108, 7, 0x023f, 21, 0x0242, 1061 + 4, 0x0241, 1, 0x0242, 2, 0x023f, 3, 0x0242, 8, 0x023f, 1, 0x0242, 4, 0x023f, 3, 0x0242, 1062 + 1, 0x023f, 3, 0x0242, 1, 0x023f, 3, 0, 4, 0x023f, 3, 0x0242, 1, 108, 7, 0x023f, 1063 + 26, 0x0242, 2, 0x023f, 3, 0x0242, 8, 0x023f, 1, 0x0242, 3, 0x023f, 40, 0, 1, 0x026f, 1064 + 69, 0, 1, 0x0270, 44, 0, 1, 0x0271, 100, 0, 1, 0x0272, 21, 0, 1, 0x0273, 1065 + 1, 0, 4, 0x0249, 1, 0x0274, 4, 0x0249, 2, 244, 1, 63, 7, 0x0249, 1, 244, 1066 + 1, 0x0249, 1, 0x0275, 1, 0x0249, 1, 0x0276, 1, 0x0134, 1, 0x0249, 1, 0x0134, 43, 0x0249, 1067 + 4, 0x0277, 1, 0x0278, 4, 0x0277, 2, 244, 1, 63, 7, 0x0277, 1, 244, 1, 0x0277, 1068 + 1, 0x0133, 1, 0x0279, 1, 0x0135, 1, 0x0172, 1, 0x0277, 1, 0x0172, 43, 0x0277, 3, 0x0170, 1069 + 1, 0x0218, 3, 0x0170, 1, 0x0218, 1, 0x0170, 2, 0x01a8, 1, 0x01a9, 7, 0x0170, 1, 0x01a8, 1070 + 1, 0x01aa, 2, 0x0170, 1, 0x01a8, 24, 0x0170, 1, 0x0218, 1, 0x0170, 2, 0x0218, 22, 0x0170, 1071 + 1, 0x027a, 1, 0x0170, 1, 0x027b, 2, 0x0170, 2, 0x01a8, 1, 0x01a9, 7, 0x0170, 1, 0x01a8, 1072 + 1, 0x01aa, 2, 0x0170, 1, 0x01a8, 47, 0x0170, 3, 0x027c, 3, 0x0170, 1, 0x027c, 1, 0x0170, 1073 + 2, 0x01a8, 1, 0x01a9, 7, 0x0170, 1, 0x01a8, 1, 0x01aa, 2, 0x0170, 1, 0x01a8, 10, 0x0170, 1074 + 2, 0x027c, 3, 0x0170, 1, 0x027c, 1, 0x0170, 1, 0x027c, 1, 0x0170, 1, 0x027c, 2, 0x0170, 1075 + 1, 0x027c, 1, 0x0170, 4, 0x027c, 3, 0x0170, 1, 0x027c, 1, 0x0170, 1, 0x027c, 15, 0x0170, 1076 + 1, 0x024b, 3, 0x0170, 1, 0x024b, 1, 0x0170, 2, 0x01a8, 1, 0x01a9, 7, 0x0170, 1, 0x01a8, 1077 + 1, 0x01aa, 2, 0x0170, 1, 0x01a8, 24, 0x0170, 1, 0x024b, 1, 0x0170, 2, 0x024b, 18, 0x0170, 1078 + 4, 0x024f, 1, 0x027d, 4, 0x024f, 3, 63, 7, 0x024f, 1, 63, 1, 0x024f, 1, 0x027e, 1079 + 1, 0x024f, 1, 0x027f, 1, 159, 1, 0x024f, 1, 159, 43, 0x024f, 4, 0x0280, 1, 0x0281, 1080 + 4, 0x0280, 3, 63, 7, 0x0280, 1, 63, 1, 0x0280, 1, 158, 1, 0x0282, 1, 160, 1081 + 1, 164, 1, 0x0280, 1, 164, 43, 0x0280, 3, 161, 1, 0x021f, 3, 161, 1, 0x021f, 1082 + 12, 161, 1, 243, 2, 161, 1, 0x01a9, 24, 161, 1, 0x021f, 1, 161, 2, 0x021f, 1083 + 22, 161, 1, 0x0283, 1, 161, 1, 0x0284, 13, 161, 1, 243, 2, 161, 1, 0x01a9, 1084 + 47, 161, 3, 0x0285, 3, 161, 1, 0x0285, 12, 161, 1, 243, 2, 161, 1, 0x01a9, 1085 + 10, 161, 2, 0x0285, 3, 161, 1, 0x0285, 1, 161, 1, 0x0285, 1, 161, 1, 0x0285, 1086 + 2, 161, 1, 0x0285, 1, 161, 4, 0x0285, 3, 161, 1, 0x0285, 1, 161, 1, 0x0285, 1087 + 15, 161, 1, 0x0251, 3, 161, 1, 0x0251, 12, 161, 1, 243, 2, 161, 1, 0x01a9, 1088 + 24, 161, 1, 0x0251, 1, 161, 2, 0x0251, 18, 161, 1, 162, 3, 0x0172, 3, 162, 1089 + 1, 0x0172, 1, 162, 2, 244, 1, 63, 7, 162, 1, 244, 14, 162, 2, 0x0172, 1090 + 3, 162, 1, 0x0172, 1, 162, 1, 0x0172, 1, 162, 1, 0x0172, 2, 162, 1, 0x0172, 1091 + 1, 162, 4, 0x0172, 3, 162, 1, 0x0172, 1, 162, 1, 0x0172, 12, 162, 9, 181, 1092 + 2, 89, 1, 90, 7, 181, 1, 89, 13, 181, 1, 0x0286, 45, 181, 2, 89, 1093 + 1, 90, 7, 181, 1, 89, 4, 181, 1, 0x0287, 54, 181, 2, 89, 1, 90, 1094 + 7, 181, 1, 89, 12, 181, 1, 0x0288, 37, 181, 1, 0, 3, 108, 1, 0, 1095 + 3, 108, 1, 0x0289, 7, 0, 2, 108, 1, 0x028a, 1, 108, 6, 0, 1, 110, 1096 + 26, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 1097 + 3, 108, 8, 0, 4, 108, 7, 0, 13, 108, 1, 0x028b, 12, 108, 2, 0, 1098 + 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 1099 + 4, 108, 7, 0, 7, 108, 1, 0x023e, 18, 108, 2, 0, 3, 108, 8, 0, 1100 + 1, 108, 3, 0, 8, 0x022b, 1, 0x025e, 3, 0, 2, 0x01f8, 4, 0x022b, 1, 0x025e, 1101 + 1, 0, 50, 0x022b, 1, 0, 3, 0x025f, 1, 0, 3, 0x025f, 1, 0x028c, 3, 0, 1102 + 2, 0x028d, 2, 0, 4, 0x025f, 7, 0, 26, 0x025f, 2, 0, 3, 0x025f, 8, 0, 1103 + 1, 0x025f, 4, 0, 3, 0x0260, 1, 0, 3, 0x0260, 1, 0x028e, 3, 0, 1, 0x022f, 1104 + 3, 0, 4, 0x0260, 7, 0, 26, 0x0260, 2, 0, 3, 0x0260, 8, 0, 1, 0x0260, 1105 + 3, 0, 2, 0x028f, 1, 0x0290, 2, 0x028f, 2, 0x0290, 1, 0x028f, 1, 0x0261, 3, 0, 1106 + 4, 0x028f, 1, 0x0290, 1, 0x028f, 1, 0x0261, 1, 0, 7, 0x028f, 21, 0x0290, 4, 0x028f, 1107 + 1, 0x0290, 2, 0x028f, 3, 0x0290, 8, 0x028f, 1, 0x0290, 4, 0x028f, 1, 0x0291, 1, 0x0290, 1108 + 1, 0x0291, 1, 0x028f, 2, 0x0290, 1, 0x0291, 1, 0x0261, 3, 0, 4, 0x028f, 1, 0x0290, 1109 + 1, 0x0291, 1, 0x0262, 1, 108, 7, 0x028f, 21, 0x0290, 4, 0x0291, 1, 0x0290, 2, 0x028f, 1110 + 3, 0x0290, 8, 0x028f, 1, 0x0290, 3, 0x028f, 8, 0, 1, 0x0263, 9, 0, 1, 0x0263, 1111 + 10, 0, 1, 0x0292, 5, 0, 1, 0x0293, 35, 0, 3, 108, 1, 0, 3, 108, 1112 + 1, 0x0263, 7, 0, 2, 108, 1, 0x0264, 1, 108, 7, 0, 2, 108, 1, 0x0294, 1113 + 5, 108, 1, 0x0295, 17, 108, 2, 0, 3, 108, 8, 0, 1, 108, 5, 0, 1114 + 1, 0x0296, 2, 0, 2, 0x0296, 1, 0, 1, 0x0265, 7, 0, 1, 0x0296, 1, 0, 1115 + 1, 0x0265, 8, 0, 21, 0x0296, 4, 0, 1, 0x0296, 2, 0, 3, 0x0296, 8, 0, 1116 + 1, 0x0296, 4, 0, 1, 108, 1, 0x0296, 1, 108, 1, 0, 2, 0x0296, 1, 108, 1117 + 1, 0x0265, 7, 0, 1, 0x0296, 1, 108, 1, 0x0266, 1, 108, 7, 0, 21, 0x0296, 1118 + 4, 108, 1, 0x0296, 2, 0, 3, 0x0296, 8, 0, 1, 0x0296, 4, 0, 3, 108, 1119 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 6, 108, 1, 0x0297, 19, 108, 1120 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 1121 + 8, 0, 4, 108, 7, 0, 7, 108, 1, 0x0298, 18, 108, 2, 0, 3, 108, 1122 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 1123 + 7, 0, 7, 108, 1, 0x0299, 18, 108, 2, 0, 3, 108, 8, 0, 1, 108, 1124 + 4, 0, 3, 108, 1, 0, 3, 108, 1, 0x029a, 7, 0, 2, 108, 1, 0x029b, 1125 + 1, 108, 7, 0, 26, 108, 2, 0, 3, 108, 8, 0, 1, 108, 3, 0, 1126 + 8, 0x0239, 1, 0x026b, 3, 0, 1, 0x0205, 5, 0x0239, 1, 0x026b, 1, 0, 50, 0x0239, 1127 + 1, 0, 3, 0x026c, 1, 0, 3, 0x026c, 1, 0x029c, 3, 0, 1, 0x029d, 3, 0, 1128 + 4, 0x026c, 7, 0, 26, 0x026c, 2, 0, 3, 0x026c, 8, 0, 1, 0x026c, 3, 0, 1129 + 8, 0x023f, 1, 0x026d, 3, 0, 6, 0x023f, 1, 0x026d, 1, 0, 51, 0x023f, 3, 0x0242, 1130 + 1, 0x023f, 3, 0x0242, 1, 0x026d, 3, 0, 4, 0x023f, 2, 0x0242, 1, 0x026e, 1, 108, 1131 + 7, 0x023f, 26, 0x0242, 2, 0x023f, 3, 0x0242, 8, 0x023f, 1, 0x0242, 3, 0x023f, 34, 0, 1132 + 1, 0x029e, 69, 0, 1, 0x029f, 62, 0, 1, 0x02a0, 57, 0, 1, 0x02a1, 54, 0, 1133 + 9, 0x0249, 2, 244, 1, 63, 7, 0x0249, 1, 244, 1, 0x0249, 1, 0x0275, 1, 0x0134, 1134 + 1, 0x0276, 1, 0x0134, 1, 0x0249, 1, 0x0134, 47, 0x0249, 1, 0x0274, 4, 0x0249, 2, 244, 1135 + 1, 63, 7, 0x0249, 1, 244, 1, 0x01e1, 1, 0x0134, 1, 244, 47, 0x0249, 4, 0x0279, 1136 + 1, 0x02a2, 4, 0x0279, 2, 244, 1, 63, 7, 0x0279, 1, 244, 2, 0x0279, 1, 0x0277, 1137 + 1, 0x0134, 46, 0x0279, 11, 244, 1, 63, 9, 244, 1, 0x0133, 1, 0x0134, 1, 0x024a, 1138 + 1, 162, 1, 244, 1, 162, 43, 244, 3, 0x0277, 1, 0x02a3, 1, 0x02a4, 1, 0x0277, 1139 + 1, 0x02a5, 1, 0x02a6, 1, 0x0277, 2, 244, 1, 63, 7, 0x0277, 1, 244, 1, 0x0277, 1140 + 1, 0x0133, 1, 0x0279, 1, 0x02a7, 1, 0x0172, 1, 0x0277, 1, 0x0172, 21, 0x0277, 1, 0x02a3, 1141 + 1, 0x0277, 1, 0x02a6, 1, 0x02a3, 18, 0x0277, 4, 0x0134, 1, 0x0171, 4, 0x0134, 2, 244, 1142 + 1, 63, 7, 0x0134, 1, 244, 2, 0x0134, 1, 244, 1, 0x0249, 46, 0x0134, 4, 0x0170, 1143 + 1, 0x027a, 1, 0x0170, 1, 0x027b, 2, 0x0170, 2, 0x01a8, 1, 0x01a9, 7, 0x0170, 1, 0x01a8, 1144 + 1, 0x01aa, 50, 0x0170, 3, 0x027c, 3, 0x0170, 1, 0x027c, 1, 0x0170, 2, 0x01a8, 1, 0x01a9, 1145 + 7, 0x0170, 1, 0x01a8, 1, 0x01aa, 13, 0x0170, 2, 0x027c, 3, 0x0170, 1, 0x027c, 1, 0x0170, 1146 + 1, 0x027c, 1, 0x0170, 1, 0x027c, 2, 0x0170, 1, 0x027c, 1, 0x0170, 4, 0x027c, 3, 0x0170, 1147 + 1, 0x027c, 1, 0x0170, 1, 0x027c, 13, 0x0170, 3, 0x02a8, 3, 0x0170, 1, 0x02a8, 1, 0x0170, 1148 + 2, 0x01a8, 1, 0x01a9, 7, 0x0170, 1, 0x01a8, 1, 0x01aa, 13, 0x0170, 2, 0x02a8, 3, 0x0170, 1149 + 1, 0x02a8, 1, 0x0170, 1, 0x02a8, 1, 0x0170, 1, 0x02a8, 2, 0x0170, 1, 0x02a8, 1, 0x0170, 1150 + 4, 0x02a8, 3, 0x0170, 1, 0x02a8, 1, 0x0170, 1, 0x02a8, 12, 0x0170, 9, 0x024f, 3, 63, 1151 + 7, 0x024f, 1, 63, 1, 0x024f, 1, 0x027e, 1, 159, 1, 0x027f, 1, 159, 1, 0x024f, 1152 + 1, 159, 47, 0x024f, 1, 0x027d, 4, 0x024f, 3, 63, 7, 0x024f, 1, 63, 1, 0x01e5, 1153 + 1, 0x0134, 1, 63, 47, 0x024f, 4, 0x0282, 1, 0x02a9, 4, 0x0282, 3, 0, 7, 0x0282, 1154 + 1, 0, 2, 0x0282, 1, 0x0280, 1, 159, 46, 0x0282, 21, 63, 1, 158, 1, 159, 1155 + 1, 0x0250, 1, 0, 1, 63, 1, 0, 43, 63, 3, 0x0280, 1, 0x02aa, 1, 0x02ab, 1156 + 1, 0x0280, 1, 0x02ac, 1, 0x02ad, 1, 0x0280, 3, 63, 7, 0x0280, 1, 63, 1, 0x0280, 1157 + 1, 158, 1, 0x0282, 1, 0x02ae, 1, 164, 1, 0x0280, 1, 164, 21, 0x0280, 1, 0x02aa, 1158 + 1, 0x0280, 1, 0x02ad, 1, 0x02aa, 18, 0x0280, 4, 159, 1, 163, 4, 159, 3, 0, 1159 + 7, 159, 1, 0, 2, 159, 1, 63, 1, 0x024f, 46, 159, 4, 161, 1, 0x0283, 1160 + 1, 161, 1, 0x0284, 13, 161, 1, 243, 50, 161, 3, 0x0285, 3, 161, 1, 0x0285, 1161 + 12, 161, 1, 243, 13, 161, 2, 0x0285, 3, 161, 1, 0x0285, 1, 161, 1, 0x0285, 1162 + 1, 161, 1, 0x0285, 2, 161, 1, 0x0285, 1, 161, 4, 0x0285, 3, 161, 1, 0x0285, 1163 + 1, 161, 1, 0x0285, 13, 161, 3, 0x02af, 3, 161, 1, 0x02af, 12, 161, 1, 243, 1164 + 13, 161, 2, 0x02af, 3, 161, 1, 0x02af, 1, 161, 1, 0x02af, 1, 161, 1, 0x02af, 1165 + 2, 161, 1, 0x02af, 1, 161, 4, 0x02af, 3, 161, 1, 0x02af, 1, 161, 1, 0x02af, 1166 + 12, 161, 9, 181, 2, 89, 1, 90, 7, 181, 1, 89, 4, 181, 1, 0x02b0, 1167 + 45, 181, 9, 0x0287, 2, 0x02b1, 1, 0x02b2, 7, 0x0287, 1, 0x02b1, 50, 0x0287, 9, 181, 1168 + 2, 89, 1, 90, 7, 181, 1, 89, 13, 181, 1, 0x02b3, 36, 181, 2, 0x02b4, 1169 + 1, 0x02b5, 2, 0x02b4, 2, 0x02b5, 1, 0x02b4, 1, 0x0289, 3, 0, 4, 0x02b4, 1, 0x02b5, 1170 + 1, 0x02b4, 1, 0x0289, 1, 0, 7, 0x02b4, 21, 0x02b5, 4, 0x02b4, 1, 0x02b5, 2, 0x02b4, 1171 + 3, 0x02b5, 8, 0x02b4, 1, 0x02b5, 4, 0x02b4, 1, 0x02b6, 1, 0x02b5, 1, 0x02b6, 1, 0x02b4, 1172 + 2, 0x02b5, 1, 0x02b6, 1, 0x0289, 3, 0, 4, 0x02b4, 1, 0x02b5, 1, 0x02b6, 1, 0x028a, 1173 + 1, 108, 7, 0x02b4, 21, 0x02b5, 4, 0x02b6, 1, 0x02b5, 2, 0x02b4, 3, 0x02b5, 8, 0x02b4, 1174 + 1, 0x02b5, 3, 0x02b4, 1, 0, 3, 108, 1, 0, 3, 108, 1, 0x02b7, 7, 0, 1175 + 2, 108, 1, 0x02b7, 1, 108, 7, 0, 26, 108, 2, 0, 3, 108, 8, 0, 1176 + 1, 108, 11, 0, 1, 0x028c, 3, 0, 2, 0x028d, 4, 0, 1, 0x028c, 53, 0, 1177 + 1, 0x025f, 2, 0, 2, 0x025f, 1, 0, 1, 0x028d, 7, 0, 1, 0x025f, 1, 0, 1178 + 1, 0x028d, 8, 0, 21, 0x025f, 4, 0, 1, 0x025f, 2, 0, 3, 0x025f, 8, 0, 1179 + 1, 0x025f, 11, 0, 1, 0x028e, 3, 0, 1, 0x022f, 5, 0, 1, 0x028e, 51, 0, 1180 + 9, 0x028f, 3, 0, 7, 0x028f, 1, 0, 51, 0x028f, 3, 0x0290, 1, 0x028f, 3, 0x0290, 1181 + 1, 0x02b8, 3, 0, 2, 0x0261, 2, 0x028f, 3, 0x0290, 1, 0x02b9, 7, 0x028f, 26, 0x0290, 1182 + 2, 0x028f, 3, 0x0290, 8, 0x028f, 1, 0x0290, 4, 0x028f, 3, 0x0291, 1, 0x028f, 3, 0x0291, 1183 + 1, 0x028f, 3, 0, 4, 0x028f, 3, 0x0291, 1, 108, 7, 0x028f, 26, 0x0291, 2, 0x028f, 1184 + 3, 0x0291, 8, 0x028f, 1, 0x0291, 3, 0x028f, 31, 0, 1, 0x02ba, 77, 0, 1, 0x02bb, 1185 + 31, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 4, 108, 1186 + 1, 0x02bc, 21, 108, 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 108, 1187 + 1, 0, 3, 108, 8, 0, 4, 108, 7, 0, 12, 108, 1, 0x02bd, 13, 108, 1188 + 2, 0, 3, 108, 8, 0, 1, 108, 4, 0, 3, 0x0296, 1, 0, 3, 0x0296, 1189 + 1, 0x02be, 7, 0, 4, 0x0296, 7, 0, 26, 0x0296, 2, 0, 3, 0x0296, 8, 0, 1190 + 1, 0x0296, 4, 0, 3, 108, 1, 0, 3, 108, 1, 0x02bf, 7, 0, 2, 108, 1191 + 1, 0x02c0, 1, 108, 6, 0, 1, 110, 26, 108, 2, 0, 3, 108, 8, 0, 1192 + 1, 108, 3, 0, 2, 0x02c1, 1, 0x02c2, 2, 0x02c1, 2, 0x02c2, 1, 0x02c1, 1, 0x029a, 1193 + 3, 0, 4, 0x02c1, 1, 0x02c2, 1, 0x02c1, 1, 0x029a, 1, 0, 7, 0x02c1, 21, 0x02c2, 1194 + 4, 0x02c1, 1, 0x02c2, 2, 0x02c1, 3, 0x02c2, 8, 0x02c1, 1, 0x02c2, 4, 0x02c1, 1, 0x02c3, 1195 + 1, 0x02c2, 1, 0x02c3, 1, 0x02c1, 2, 0x02c2, 1, 0x02c3, 1, 0x029a, 3, 0, 4, 0x02c1, 1196 + 1, 0x02c2, 1, 0x02c3, 1, 0x029b, 1, 108, 7, 0x02c1, 21, 0x02c2, 4, 0x02c3, 1, 0x02c2, 1197 + 2, 0x02c1, 3, 0x02c2, 8, 0x02c1, 1, 0x02c2, 3, 0x02c1, 8, 0, 1, 0x029c, 3, 0, 1198 + 1, 0x029d, 5, 0, 1, 0x029c, 53, 0, 1, 0x026c, 2, 0, 2, 0x026c, 1, 0, 1199 + 1, 0x029d, 7, 0, 1, 0x026c, 1, 0, 1, 0x029d, 8, 0, 21, 0x026c, 4, 0, 1200 + 1, 0x026c, 2, 0, 3, 0x026c, 8, 0, 1, 0x026c, 71, 0, 1, 0x02c4, 69, 0, 1201 + 1, 0x02c5, 48, 0, 1, 0x02c6, 22, 0, 3, 0x0279, 1, 0x02c7, 1, 0x02c8, 1, 0x0279, 1202 + 1, 0x02c9, 1, 0x02ca, 1, 0x0279, 2, 244, 1, 63, 7, 0x0279, 1, 244, 28, 0x0279, 1203 + 1, 0x02c7, 1, 0x0279, 1, 0x02ca, 1, 0x02c7, 18, 0x0279, 3, 244, 1, 0x0277, 3, 244, 1204 + 1, 0x0277, 3, 244, 1, 63, 9, 244, 1, 0x0133, 1, 0x0134, 1, 0x024a, 1, 162, 1205 + 1, 244, 1, 162, 21, 244, 1, 0x0277, 1, 244, 2, 0x0277, 22, 244, 1, 0x02cb, 1206 + 1, 244, 1, 0x02cc, 4, 244, 1, 63, 9, 244, 1, 0x0133, 1, 0x0134, 1, 0x024a, 1207 + 1, 162, 1, 244, 1, 162, 44, 244, 3, 0x02cd, 3, 244, 1, 0x02cd, 3, 244, 1208 + 1, 63, 9, 244, 1, 0x0133, 1, 0x0134, 1, 0x024a, 1, 162, 1, 244, 1, 162, 1209 + 7, 244, 2, 0x02cd, 3, 244, 1, 0x02cd, 1, 244, 1, 0x02cd, 1, 244, 1, 0x02cd, 1210 + 2, 244, 1, 0x02cd, 1, 244, 4, 0x02cd, 3, 244, 1, 0x02cd, 1, 244, 1, 0x02cd, 1211 + 15, 244, 1, 0x02a3, 3, 244, 1, 0x02a3, 3, 244, 1, 63, 9, 244, 1, 0x0133, 1212 + 1, 0x0134, 1, 0x024a, 1, 162, 1, 244, 1, 162, 21, 244, 1, 0x02a3, 1, 244, 1213 + 2, 0x02a3, 18, 244, 4, 0x0172, 1, 0x0173, 4, 0x0172, 2, 244, 1, 63, 7, 0x0172, 1214 + 1, 244, 3, 0x0172, 1, 244, 46, 0x0172, 1, 0x0170, 3, 0x02ce, 3, 0x0170, 1, 0x02ce, 1215 + 1, 0x0170, 2, 0x01a8, 1, 0x01a9, 7, 0x0170, 1, 0x01a8, 1, 0x01aa, 13, 0x0170, 2, 0x02ce, 1216 + 3, 0x0170, 1, 0x02ce, 1, 0x0170, 1, 0x02ce, 1, 0x0170, 1, 0x02ce, 2, 0x0170, 1, 0x02ce, 1217 + 1, 0x0170, 4, 0x02ce, 3, 0x0170, 1, 0x02ce, 1, 0x0170, 1, 0x02ce, 12, 0x0170, 3, 0x0282, 1218 + 1, 0x02cf, 1, 0x02d0, 1, 0x0282, 1, 0x02d1, 1, 0x02d2, 1, 0x0282, 3, 0, 7, 0x0282, 1219 + 1, 0, 28, 0x0282, 1, 0x02cf, 1, 0x0282, 1, 0x02d2, 1, 0x02cf, 18, 0x0282, 3, 63, 1220 + 1, 0x0280, 3, 63, 1, 0x0280, 13, 63, 1, 158, 1, 159, 1, 0x0250, 1, 0, 1221 + 1, 63, 1, 0, 21, 63, 1, 0x0280, 1, 63, 2, 0x0280, 22, 63, 1, 0x02d3, 1222 + 1, 63, 1, 0x02d4, 14, 63, 1, 158, 1, 159, 1, 0x0250, 1, 0, 1, 63, 1223 + 1, 0, 44, 63, 3, 0x02d5, 3, 63, 1, 0x02d5, 13, 63, 1, 158, 1, 159, 1224 + 1, 0x0250, 1, 0, 1, 63, 1, 0, 7, 63, 2, 0x02d5, 3, 63, 1, 0x02d5, 1225 + 1, 63, 1, 0x02d5, 1, 63, 1, 0x02d5, 2, 63, 1, 0x02d5, 1, 63, 4, 0x02d5, 1226 + 3, 63, 1, 0x02d5, 1, 63, 1, 0x02d5, 15, 63, 1, 0x02aa, 3, 63, 1, 0x02aa, 1227 + 13, 63, 1, 158, 1, 159, 1, 0x0250, 1, 0, 1, 63, 1, 0, 21, 63, 1228 + 1, 0x02aa, 1, 63, 2, 0x02aa, 18, 63, 4, 164, 1, 165, 4, 164, 3, 0, 1229 + 7, 164, 1, 0, 3, 164, 1, 63, 46, 164, 1, 161, 3, 0x02d6, 3, 161, 1230 + 1, 0x02d6, 12, 161, 1, 243, 13, 161, 2, 0x02d6, 3, 161, 1, 0x02d6, 1, 161, 1231 + 1, 0x02d6, 1, 161, 1, 0x02d6, 2, 161, 1, 0x02d6, 1, 161, 4, 0x02d6, 3, 161, 1232 + 1, 0x02d6, 1, 161, 1, 0x02d6, 12, 161, 9, 0x02b0, 2, 0x02d7, 1, 0x02d8, 7, 0x02b0, 1233 + 1, 0x02d7, 50, 0x02b0, 9, 181, 2, 89, 1, 90, 7, 181, 1, 89, 4, 181, 1234 + 1, 0x02d9, 45, 181, 9, 0x02b4, 3, 0, 7, 0x02b4, 1, 0, 51, 0x02b4, 3, 0x02b5, 1235 + 1, 0x02b4, 3, 0x02b5, 1, 0x02da, 3, 0, 2, 0x0289, 2, 0x02b4, 3, 0x02b5, 1, 0x02db, 1236 + 7, 0x02b4, 26, 0x02b5, 2, 0x02b4, 3, 0x02b5, 8, 0x02b4, 1, 0x02b5, 4, 0x02b4, 3, 0x02b6, 1237 + 1, 0x02b4, 3, 0x02b6, 1, 0x02b4, 3, 0, 4, 0x02b4, 3, 0x02b6, 1, 108, 7, 0x02b4, 1238 + 26, 0x02b6, 2, 0x02b4, 3, 0x02b6, 8, 0x02b4, 1, 0x02b6, 3, 0x02b4, 11, 0x02b7, 1, 0, 1239 + 58, 0x02b7, 8, 0x028f, 1, 0x02b8, 3, 0, 2, 0x0261, 4, 0x028f, 1, 0x02b8, 1, 0, 1240 + 50, 0x028f, 1, 0, 3, 0x02b9, 1, 0, 3, 0x02b9, 1, 0x02dc, 3, 0, 2, 0x02dd, 1241 + 2, 0, 4, 0x02b9, 7, 0, 26, 0x02b9, 2, 0, 3, 0x02b9, 8, 0, 1, 0x02b9, 1242 + 9, 0, 1, 0x02de, 100, 0, 1, 0x02df, 33, 0, 3, 108, 1, 0, 1, 108, 1243 + 1, 0x02e0, 1, 108, 8, 0, 4, 108, 7, 0, 26, 108, 2, 0, 3, 108, 1244 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 1245 + 7, 0, 10, 108, 1, 0x02e1, 15, 108, 2, 0, 3, 108, 8, 0, 1, 108, 1246 + 11, 0, 1, 0x02be, 9, 0, 1, 0x02be, 51, 0, 2, 0x02e2, 1, 0x02e3, 2, 0x02e2, 1247 + 2, 0x02e3, 1, 0x02e2, 1, 0x02bf, 3, 0, 4, 0x02e2, 1, 0x02e3, 1, 0x02e2, 1, 0x02bf, 1248 + 1, 0, 7, 0x02e2, 21, 0x02e3, 4, 0x02e2, 1, 0x02e3, 2, 0x02e2, 3, 0x02e3, 8, 0x02e2, 1249 + 1, 0x02e3, 4, 0x02e2, 1, 0x02e4, 1, 0x02e3, 1, 0x02e4, 1, 0x02e2, 2, 0x02e3, 1, 0x02e4, 1250 + 1, 0x02bf, 3, 0, 4, 0x02e2, 1, 0x02e3, 1, 0x02e4, 1, 0x02c0, 1, 108, 7, 0x02e2, 1251 + 21, 0x02e3, 4, 0x02e4, 1, 0x02e3, 2, 0x02e2, 3, 0x02e3, 8, 0x02e2, 1, 0x02e3, 3, 0x02e2, 1252 + 9, 0x02c1, 3, 0, 7, 0x02c1, 1, 0, 51, 0x02c1, 3, 0x02c2, 1, 0x02c1, 3, 0x02c2, 1253 + 1, 0x02e5, 3, 0, 1, 0x029a, 3, 0x02c1, 3, 0x02c2, 1, 0x02e6, 7, 0x02c1, 26, 0x02c2, 1254 + 2, 0x02c1, 3, 0x02c2, 8, 0x02c1, 1, 0x02c2, 4, 0x02c1, 3, 0x02c3, 1, 0x02c1, 3, 0x02c3, 1255 + 1, 0x02c1, 3, 0, 4, 0x02c1, 3, 0x02c3, 1, 108, 7, 0x02c1, 26, 0x02c3, 2, 0x02c1, 1256 + 3, 0x02c3, 8, 0x02c1, 1, 0x02c3, 3, 0x02c1, 15, 0, 1, 0x02e7, 69, 0, 1, 0x02e8, 1257 + 81, 0, 1, 0x02e9, 42, 0, 3, 0x0134, 1, 0x0279, 1, 0x0171, 2, 0x0134, 1, 0x0279, 1258 + 1, 0x0134, 2, 244, 1, 63, 7, 0x0134, 1, 244, 2, 0x0134, 1, 244, 1, 0x0249, 1259 + 24, 0x0134, 1, 0x0279, 1, 0x0134, 2, 0x0279, 22, 0x0134, 1, 0x02ea, 1, 0x0134, 1, 0x02eb, 1260 + 2, 0x0134, 2, 244, 1, 63, 7, 0x0134, 1, 244, 2, 0x0134, 1, 244, 1, 0x0249, 1261 + 47, 0x0134, 3, 0x02ec, 1, 0x0171, 2, 0x0134, 1, 0x02ec, 1, 0x0134, 2, 244, 1, 63, 1262 + 7, 0x0134, 1, 244, 2, 0x0134, 1, 244, 1, 0x0249, 10, 0x0134, 2, 0x02ec, 3, 0x0134, 1263 + 1, 0x02ec, 1, 0x0134, 1, 0x02ec, 1, 0x0134, 1, 0x02ec, 2, 0x0134, 1, 0x02ec, 1, 0x0134, 1264 + 4, 0x02ec, 3, 0x0134, 1, 0x02ec, 1, 0x0134, 1, 0x02ec, 15, 0x0134, 1, 0x02c7, 1, 0x0171, 1265 + 2, 0x0134, 1, 0x02c7, 1, 0x0134, 2, 244, 1, 63, 7, 0x0134, 1, 244, 2, 0x0134, 1266 + 1, 244, 1, 0x0249, 24, 0x0134, 1, 0x02c7, 1, 0x0134, 2, 0x02c7, 18, 0x0134, 4, 244, 1267 + 1, 0x02cb, 1, 244, 1, 0x02cc, 4, 244, 1, 63, 9, 244, 1, 0x0133, 1, 0x0134, 1268 + 1, 0x0135, 1, 162, 1, 244, 1, 162, 44, 244, 3, 0x02cd, 3, 244, 1, 0x02cd, 1269 + 3, 244, 1, 63, 9, 244, 1, 0x0133, 1, 0x0134, 1, 0x0135, 1, 162, 1, 244, 1270 + 1, 162, 7, 244, 2, 0x02cd, 3, 244, 1, 0x02cd, 1, 244, 1, 0x02cd, 1, 244, 1271 + 1, 0x02cd, 2, 244, 1, 0x02cd, 1, 244, 4, 0x02cd, 3, 244, 1, 0x02cd, 1, 244, 1272 + 1, 0x02cd, 13, 244, 3, 0x02ed, 3, 244, 1, 0x02ed, 3, 244, 1, 63, 9, 244, 1273 + 1, 0x0133, 1, 0x0134, 1, 0x0135, 1, 162, 1, 244, 1, 162, 7, 244, 2, 0x02ed, 1274 + 3, 244, 1, 0x02ed, 1, 244, 1, 0x02ed, 1, 244, 1, 0x02ed, 2, 244, 1, 0x02ed, 1275 + 1, 244, 4, 0x02ed, 3, 244, 1, 0x02ed, 1, 244, 1, 0x02ed, 12, 244, 1, 0x0170, 1276 + 3, 0x0218, 3, 0x0170, 1, 0x0218, 1, 0x0170, 2, 0x01a8, 1, 0x01a9, 7, 0x0170, 1, 0x01a8, 1277 + 1, 0x01aa, 13, 0x0170, 2, 0x0218, 3, 0x0170, 1, 0x0218, 1, 0x0170, 1, 0x0218, 1, 0x0170, 1278 + 1, 0x0218, 2, 0x0170, 1, 0x0218, 1, 0x0170, 4, 0x0218, 3, 0x0170, 1, 0x0218, 1, 0x0170, 1279 + 1, 0x0218, 12, 0x0170, 3, 159, 1, 0x0282, 1, 163, 2, 159, 1, 0x0282, 1, 159, 1280 + 3, 0, 7, 159, 1, 0, 2, 159, 1, 63, 1, 0x024f, 24, 159, 1, 0x0282, 1281 + 1, 159, 2, 0x0282, 22, 159, 1, 0x02ee, 1, 159, 1, 0x02ef, 2, 159, 3, 0, 1282 + 7, 159, 1, 0, 2, 159, 1, 63, 1, 0x024f, 47, 159, 3, 0x02f0, 1, 163, 1283 + 2, 159, 1, 0x02f0, 1, 159, 3, 0, 7, 159, 1, 0, 2, 159, 1, 63, 1284 + 1, 0x024f, 10, 159, 2, 0x02f0, 3, 159, 1, 0x02f0, 1, 159, 1, 0x02f0, 1, 159, 1285 + 1, 0x02f0, 2, 159, 1, 0x02f0, 1, 159, 4, 0x02f0, 3, 159, 1, 0x02f0, 1, 159, 1286 + 1, 0x02f0, 15, 159, 1, 0x02cf, 1, 163, 2, 159, 1, 0x02cf, 1, 159, 3, 0, 1287 + 7, 159, 1, 0, 2, 159, 1, 63, 1, 0x024f, 24, 159, 1, 0x02cf, 1, 159, 1288 + 2, 0x02cf, 18, 159, 4, 63, 1, 0x02d3, 1, 63, 1, 0x02d4, 14, 63, 1, 158, 1289 + 1, 159, 1, 160, 1, 0, 1, 63, 1, 0, 44, 63, 3, 0x02d5, 3, 63, 1290 + 1, 0x02d5, 13, 63, 1, 158, 1, 159, 1, 160, 1, 0, 1, 63, 1, 0, 1291 + 7, 63, 2, 0x02d5, 3, 63, 1, 0x02d5, 1, 63, 1, 0x02d5, 1, 63, 1, 0x02d5, 1292 + 2, 63, 1, 0x02d5, 1, 63, 4, 0x02d5, 3, 63, 1, 0x02d5, 1, 63, 1, 0x02d5, 1293 + 13, 63, 3, 0x02f1, 3, 63, 1, 0x02f1, 13, 63, 1, 158, 1, 159, 1, 160, 1294 + 1, 0, 1, 63, 1, 0, 7, 63, 2, 0x02f1, 3, 63, 1, 0x02f1, 1, 63, 1295 + 1, 0x02f1, 1, 63, 1, 0x02f1, 2, 63, 1, 0x02f1, 1, 63, 4, 0x02f1, 3, 63, 1296 + 1, 0x02f1, 1, 63, 1, 0x02f1, 12, 63, 1, 161, 3, 0x021f, 3, 161, 1, 0x021f, 1297 + 12, 161, 1, 243, 13, 161, 2, 0x021f, 3, 161, 1, 0x021f, 1, 161, 1, 0x021f, 1298 + 1, 161, 1, 0x021f, 2, 161, 1, 0x021f, 1, 161, 4, 0x021f, 3, 161, 1, 0x021f, 1299 + 1, 161, 1, 0x021f, 12, 161, 9, 0x02d9, 2, 0x02f2, 1, 0x02f3, 7, 0x02d9, 1, 0x02f2, 1300 + 50, 0x02d9, 8, 0x02b4, 1, 0x02da, 3, 0, 2, 0x0289, 4, 0x02b4, 1, 0x02da, 1, 0, 1301 + 50, 0x02b4, 1, 0, 3, 0x02db, 1, 0, 3, 0x02db, 1, 0x02f4, 3, 0, 2, 0x02f5, 1302 + 2, 0, 4, 0x02db, 7, 0, 26, 0x02db, 2, 0, 3, 0x02db, 8, 0, 1, 0x02db, 1303 + 11, 0, 1, 0x02dc, 3, 0, 2, 0x02dd, 4, 0, 1, 0x02dc, 53, 0, 1, 0x02b9, 1304 + 2, 0, 2, 0x02b9, 1, 0, 1, 0x02dd, 7, 0, 1, 0x02b9, 1, 0, 1, 0x02dd, 1305 + 8, 0, 21, 0x02b9, 4, 0, 1, 0x02b9, 2, 0, 3, 0x02b9, 8, 0, 1, 0x02b9, 1306 + 37, 0, 1, 0x02f6, 75, 0, 1, 0x02f7, 30, 0, 3, 108, 1, 0, 3, 108, 1307 + 8, 0, 4, 108, 7, 0, 7, 108, 1, 0x02f8, 18, 108, 2, 0, 3, 108, 1308 + 8, 0, 1, 108, 4, 0, 3, 108, 1, 0, 3, 108, 8, 0, 4, 108, 1309 + 7, 0, 13, 108, 1, 0x02f9, 12, 108, 2, 0, 3, 108, 8, 0, 1, 108, 1310 + 3, 0, 9, 0x02e2, 3, 0, 7, 0x02e2, 1, 0, 51, 0x02e2, 3, 0x02e3, 1, 0x02e2, 1311 + 3, 0x02e3, 1, 0x02fa, 3, 0, 2, 0x02bf, 2, 0x02e2, 3, 0x02e3, 1, 0x02fb, 7, 0x02e2, 1312 + 26, 0x02e3, 2, 0x02e2, 3, 0x02e3, 8, 0x02e2, 1, 0x02e3, 4, 0x02e2, 3, 0x02e4, 1, 0x02e2, 1313 + 3, 0x02e4, 1, 0x02e2, 3, 0, 4, 0x02e2, 3, 0x02e4, 1, 108, 7, 0x02e2, 26, 0x02e4, 1314 + 2, 0x02e2, 3, 0x02e4, 8, 0x02e2, 1, 0x02e4, 3, 0x02e2, 8, 0x02c1, 1, 0x02e5, 3, 0, 1315 + 1, 0x029a, 5, 0x02c1, 1, 0x02e5, 1, 0, 50, 0x02c1, 1, 0, 3, 0x02e6, 1, 0, 1316 + 3, 0x02e6, 1, 0x02fc, 3, 0, 1, 0x02fd, 3, 0, 4, 0x02e6, 7, 0, 26, 0x02e6, 1317 + 2, 0, 3, 0x02e6, 8, 0, 1, 0x02e6, 32, 0, 1, 0x02fe, 40, 0, 4, 0x0134, 1318 + 1, 0x02ff, 1, 0x0134, 1, 0x02eb, 2, 0x0134, 2, 244, 1, 63, 7, 0x0134, 1, 244, 1319 + 51, 0x0134, 3, 0x02ec, 1, 0x0171, 2, 0x0134, 1, 0x02ec, 1, 0x0134, 2, 244, 1, 63, 1320 + 7, 0x0134, 1, 244, 2, 0x0134, 1, 244, 11, 0x0134, 2, 0x02ec, 3, 0x0134, 1, 0x02ec, 1321 + 1, 0x0134, 1, 0x02ec, 1, 0x0134, 1, 0x02ec, 2, 0x0134, 1, 0x02ec, 1, 0x0134, 4, 0x02ec, 1322 + 3, 0x0134, 1, 0x02ec, 1, 0x0134, 1, 0x02ec, 13, 0x0134, 3, 0x0300, 1, 0x0171, 2, 0x0134, 1323 + 1, 0x0300, 1, 0x0134, 2, 244, 1, 63, 7, 0x0134, 1, 244, 2, 0x0134, 1, 244, 1324 + 11, 0x0134, 2, 0x0300, 3, 0x0134, 1, 0x0300, 1, 0x0134, 1, 0x0300, 1, 0x0134, 1, 0x0300, 1325 + 2, 0x0134, 1, 0x0300, 1, 0x0134, 4, 0x0300, 3, 0x0134, 1, 0x0300, 1, 0x0134, 1, 0x0300, 1326 + 12, 0x0134, 1, 244, 3, 0x0301, 3, 244, 1, 0x0301, 3, 244, 1, 63, 9, 244, 1327 + 1, 0x0133, 1, 0x0134, 1, 0x0135, 1, 162, 1, 244, 1, 162, 7, 244, 2, 0x0301, 1328 + 3, 244, 1, 0x0301, 1, 244, 1, 0x0301, 1, 244, 1, 0x0301, 2, 244, 1, 0x0301, 1329 + 1, 244, 4, 0x0301, 3, 244, 1, 0x0301, 1, 244, 1, 0x0301, 12, 244, 4, 159, 1330 + 1, 0x0302, 1, 159, 1, 0x02ef, 2, 159, 3, 0, 7, 159, 1, 0, 51, 159, 1331 + 3, 0x02f0, 1, 163, 2, 159, 1, 0x02f0, 1, 159, 3, 0, 7, 159, 1, 0, 1332 + 2, 159, 1, 63, 11, 159, 2, 0x02f0, 3, 159, 1, 0x02f0, 1, 159, 1, 0x02f0, 1333 + 1, 159, 1, 0x02f0, 2, 159, 1, 0x02f0, 1, 159, 4, 0x02f0, 3, 159, 1, 0x02f0, 1334 + 1, 159, 1, 0x02f0, 13, 159, 3, 0x0303, 1, 163, 2, 159, 1, 0x0303, 1, 159, 1335 + 3, 0, 7, 159, 1, 0, 2, 159, 1, 63, 11, 159, 2, 0x0303, 3, 159, 1336 + 1, 0x0303, 1, 159, 1, 0x0303, 1, 159, 1, 0x0303, 2, 159, 1, 0x0303, 1, 159, 1337 + 4, 0x0303, 3, 159, 1, 0x0303, 1, 159, 1, 0x0303, 12, 159, 1, 63, 3, 0x0304, 1338 + 3, 63, 1, 0x0304, 13, 63, 1, 158, 1, 159, 1, 160, 1, 0, 1, 63, 1339 + 1, 0, 7, 63, 2, 0x0304, 3, 63, 1, 0x0304, 1, 63, 1, 0x0304, 1, 63, 1340 + 1, 0x0304, 2, 63, 1, 0x0304, 1, 63, 4, 0x0304, 3, 63, 1, 0x0304, 1, 63, 1341 + 1, 0x0304, 12, 63, 8, 0, 1, 0x02f4, 3, 0, 2, 0x02f5, 4, 0, 1, 0x02f4, 1342 + 53, 0, 1, 0x02db, 2, 0, 2, 0x02db, 1, 0, 1, 0x02f5, 7, 0, 1, 0x02db, 1343 + 1, 0, 1, 0x02f5, 8, 0, 21, 0x02db, 4, 0, 1, 0x02db, 2, 0, 3, 0x02db, 1344 + 8, 0, 1, 0x02db, 37, 0, 1, 0x0305, 36, 0, 3, 108, 1, 0, 3, 108, 1345 + 8, 0, 4, 108, 7, 0, 7, 108, 1, 0x0306, 18, 108, 2, 0, 3, 108, 1346 + 8, 0, 1, 108, 3, 0, 8, 0x02e2, 1, 0x02fa, 3, 0, 2, 0x02bf, 4, 0x02e2, 1347 + 1, 0x02fa, 1, 0, 50, 0x02e2, 1, 0, 3, 0x02fb, 1, 0, 3, 0x02fb, 1, 0x0307, 1348 + 3, 0, 2, 0x0308, 2, 0, 4, 0x02fb, 7, 0, 26, 0x02fb, 2, 0, 3, 0x02fb, 1349 + 8, 0, 1, 0x02fb, 11, 0, 1, 0x02fc, 3, 0, 1, 0x02fd, 5, 0, 1, 0x02fc, 1350 + 53, 0, 1, 0x02e6, 2, 0, 2, 0x02e6, 1, 0, 1, 0x02fd, 7, 0, 1, 0x02e6, 1351 + 1, 0, 1, 0x02fd, 8, 0, 21, 0x02e6, 4, 0, 1, 0x02e6, 2, 0, 3, 0x02e6, 1352 + 8, 0, 1, 0x02e6, 71, 0, 1, 0x0309, 1, 0, 4, 0x0134, 1, 0x02ea, 1, 0x0134, 1353 + 1, 0x02eb, 2, 0x0134, 2, 244, 1, 63, 7, 0x0134, 1, 244, 2, 0x0134, 1, 244, 1354 + 48, 0x0134, 3, 0x030a, 1, 0x0171, 2, 0x0134, 1, 0x030a, 1, 0x0134, 2, 244, 1, 63, 1355 + 7, 0x0134, 1, 244, 2, 0x0134, 1, 244, 11, 0x0134, 2, 0x030a, 3, 0x0134, 1, 0x030a, 1356 + 1, 0x0134, 1, 0x030a, 1, 0x0134, 1, 0x030a, 2, 0x0134, 1, 0x030a, 1, 0x0134, 4, 0x030a, 1357 + 3, 0x0134, 1, 0x030a, 1, 0x0134, 1, 0x030a, 12, 0x0134, 1, 244, 3, 0x0277, 3, 244, 1358 + 1, 0x0277, 3, 244, 1, 63, 9, 244, 1, 0x0133, 1, 0x0134, 1, 0x0135, 1, 162, 1359 + 1, 244, 1, 162, 7, 244, 2, 0x0277, 3, 244, 1, 0x0277, 1, 244, 1, 0x0277, 1360 + 1, 244, 1, 0x0277, 2, 244, 1, 0x0277, 1, 244, 4, 0x0277, 3, 244, 1, 0x0277, 1361 + 1, 244, 1, 0x0277, 12, 244, 4, 159, 1, 0x02ee, 1, 159, 1, 0x02ef, 2, 159, 1362 + 3, 0, 7, 159, 1, 0, 2, 159, 1, 63, 48, 159, 3, 0x030b, 1, 163, 1363 + 2, 159, 1, 0x030b, 1, 159, 3, 0, 7, 159, 1, 0, 2, 159, 1, 63, 1364 + 11, 159, 2, 0x030b, 3, 159, 1, 0x030b, 1, 159, 1, 0x030b, 1, 159, 1, 0x030b, 1365 + 2, 159, 1, 0x030b, 1, 159, 4, 0x030b, 3, 159, 1, 0x030b, 1, 159, 1, 0x030b, 1366 + 12, 159, 1, 63, 3, 0x0280, 3, 63, 1, 0x0280, 13, 63, 1, 158, 1, 159, 1367 + 1, 160, 1, 0, 1, 63, 1, 0, 7, 63, 2, 0x0280, 3, 63, 1, 0x0280, 1368 + 1, 63, 1, 0x0280, 1, 63, 1, 0x0280, 2, 63, 1, 0x0280, 1, 63, 4, 0x0280, 1369 + 3, 63, 1, 0x0280, 1, 63, 1, 0x0280, 12, 63, 8, 0, 1, 0x0307, 3, 0, 1370 + 2, 0x0308, 4, 0, 1, 0x0307, 53, 0, 1, 0x02fb, 2, 0, 2, 0x02fb, 1, 0, 1371 + 1, 0x0308, 7, 0, 1, 0x02fb, 1, 0, 1, 0x0308, 8, 0, 21, 0x02fb, 4, 0, 1372 + 1, 0x02fb, 2, 0, 3, 0x02fb, 8, 0, 1, 0x02fb, 18, 0, 1, 0x030c, 54, 0, 1373 + 1, 0x0134, 3, 0x0279, 1, 0x0171, 2, 0x0134, 1, 0x0279, 1, 0x0134, 2, 244, 1, 63, 1374 + 7, 0x0134, 1, 244, 2, 0x0134, 1, 244, 11, 0x0134, 2, 0x0279, 3, 0x0134, 1, 0x0279, 1375 + 1, 0x0134, 1, 0x0279, 1, 0x0134, 1, 0x0279, 2, 0x0134, 1, 0x0279, 1, 0x0134, 4, 0x0279, 1376 + 3, 0x0134, 1, 0x0279, 1, 0x0134, 1, 0x0279, 12, 0x0134, 1, 159, 3, 0x0282, 1, 163, 1377 + 2, 159, 1, 0x0282, 1, 159, 3, 0, 7, 159, 1, 0, 2, 159, 1, 63, 1378 + 11, 159, 2, 0x0282, 3, 159, 1, 0x0282, 1, 159, 1, 0x0282, 1, 159, 1, 0x0282, 1379 + 2, 159, 1, 0x0282, 1, 159, 4, 0x0282, 3, 159, 1, 0x0282, 1, 159, 1, 0x0282, 1380 + 12, 159, 0 }; 1381 + 1382 + private static int [] zzUnpackTrans() { 1383 + int [] result = new int[45080]; 1384 + int offset = 0; 1385 + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); 1386 + return result; 1387 + } 1388 + 1389 + private static int zzUnpackTrans(ushort[] packed, int offset, int [] result) { 1390 + int i = 0; /* index in packed string */ 1391 + int j = offset; /* index in unpacked array */ 1392 + int l = packed.Length; 1393 + while (i + 1 < l) { 1394 + int count = packed[i++]; 1395 + int value = packed[i++]; 1396 + value--; 1397 + do result[j++] = value; while (--count > 0); 1398 + } 1399 + return j; 1400 + } 1401 + 1402 + 1403 + /* error codes */ 1404 + private const int ZZ_UNKNOWN_ERROR = 0; 1405 + private const int ZZ_NO_MATCH = 1; 1406 + private const int ZZ_PUSHBACK_2BIG = 2; 1407 + 1408 + /* error messages for the codes above */ 1409 + private static readonly String[] ZZ_ERROR_MSG = new string[] { 1410 + "Unkown internal scanner error", 1411 + "Error: could not match input", 1412 + "Error: pushback value was too large" 1413 + }; 1414 + 1415 + /** 1416 + * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code> 1417 + */ 1418 + private static readonly int [] ZZ_ATTRIBUTE; 1419 + 1420 + private static readonly ushort[] ZZ_ATTRIBUTE_PACKED_0 = new ushort[] { 1421 + 2, 1, 12, 0, 3, 1, 1, 9, 4, 1, 1, 9, 2, 1, 1, 9, 1422 + 13, 1, 1, 9, 1, 1, 1, 9, 4, 1, 1, 9, 1, 1, 1, 9, 1423 + 1, 1, 1, 9, 2, 1, 1, 3, 8, 9, 4, 1, 2, 9, 2, 1, 1424 + 1, 9, 3, 1, 1, 9, 1, 1, 2, 9, 4, 1, 2, 9, 1, 1, 1425 + 1, 9, 3, 1, 1, 9, 2, 1, 1, 9, 1, 1, 1, 9, 2, 1, 1426 + 1, 9, 1, 1, 3, 0, 2, 9, 1, 0, 1, 9, 1, 0, 2, 1, 1427 + 1, 0, 13, 1, 3, 0, 1, 9, 3, 1, 2, 0, 1, 9, 1, 1, 1428 + 1, 0, 1, 9, 4, 1, 5, 9, 1, 0, 1, 1, 1, 0, 1, 9, 1429 + 2, 1, 3, 0, 1, 2, 1, 13, 1, 5, 8, 0, 1, 9, 4, 1, 1430 + 6, 9, 3, 0, 1, 9, 5, 0, 1, 1, 1, 0, 1, 9, 1, 1, 1431 + 1, 9, 2, 1, 1, 9, 28, 1, 3, 0, 6, 1, 2, 0, 1, 9, 1432 + 1, 0, 1, 1, 5, 0, 1, 9, 2, 0, 1, 1, 4, 0, 1, 9, 1433 + 1, 0, 1, 1, 1, 9, 1, 1, 1, 9, 3, 0, 33, 1, 3, 0, 1434 + 3, 1, 1, 9, 1, 0, 1, 9, 1, 1, 12, 0, 1, 9, 1, 1, 1435 + 3, 0, 37, 1, 2, 9, 1, 0, 2, 1, 1, 0, 1, 1, 11, 0, 1436 + 1, 1, 5, 0, 9, 1, 1, 0, 24, 1, 1, 9, 2, 1, 1, 0, 1437 + 1, 9, 6, 0, 2, 1, 6, 0, 1, 9, 2, 0, 1, 1, 1, 9, 1438 + 3, 0, 24, 1, 1, 0, 7, 1, 6, 0, 2, 1, 3, 0, 1, 1, 1439 + 6, 0, 1, 1, 1, 9, 4, 0, 11, 1, 1, 0, 17, 1, 1, 9, 1440 + 6, 0, 1, 1, 6, 0, 1, 1, 11, 0, 8, 1, 1, 0, 19, 1, 1441 + 4, 0, 2, 9, 2, 1, 4, 0, 2, 1, 7, 0, 1, 1, 1, 9, 1442 + 1, 0, 8, 1, 1, 0, 1, 1, 1, 0, 9, 1, 2, 0, 1, 9, 1443 + 2, 0, 1, 1, 2, 0, 2, 1, 4, 0, 1, 1, 2, 0, 2, 1, 1444 + 7, 0, 4, 1, 1, 0, 4, 1, 2, 0, 9, 1, 4, 0, 1, 9, 1445 + 1, 0, 4, 1, 3, 0, 4, 1, 3, 0, 1, 1, 1, 9, 1, 0, 1446 + 6, 1, 2, 0, 8, 1, 7, 0, 3, 1, 5, 0, 3, 1, 1, 0, 1447 + 1, 1, 1, 9, 1, 0, 3, 1, 3, 0, 7, 1, 2, 9, 4, 0, 1448 + 1, 1, 3, 0, 2, 1, 1, 9, 1, 1, 1, 0, 1, 9, 1, 0, 1449 + 5, 1, 4, 0, 1, 1, 2, 0, 1, 1, 1, 9, 2, 1, 4, 0, 1450 + 1, 9, 0 }; 1451 + 1452 + private static int [] zzUnpackAttribute() { 1453 + int [] result = new int[780]; 1454 + int offset = 0; 1455 + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); 1456 + return result; 1457 + } 1458 + 1459 + private static int zzUnpackAttribute(ushort[] packed, int offset, int [] result) { 1460 + int i = 0; /* index in packed string */ 1461 + int j = offset; /* index in unpacked array */ 1462 + int l = packed.Length; 1463 + while (i + 1 < l) { 1464 + int count = packed[i++]; 1465 + int value = packed[i++]; 1466 + do result[j++] = value; while (--count > 0); 1467 + } 1468 + return j; 1469 + } 1470 + 1471 + /** the input device */ 1472 + private System.IO.TextReader zzReader; 1473 + 1474 + /** the current state of the DFA */ 1475 + private int zzState; 1476 + 1477 + /** the current lexical state */ 1478 + private int zzLexicalState = YYINITIAL; 1479 + 1480 + /** this buffer contains the current text to be matched and is 1481 + the source of the yytext() string */ 1482 + private char[] zzBuffer = new char[ZZ_BUFFERSIZE]; 1483 + 1484 + /** the textposition at the last accepting state */ 1485 + private int zzMarkedPos; 1486 + 1487 + /** the textposition at the last state to be included in yytext */ 1488 + private int zzPushbackPos; 1489 + 1490 + /** the current text position in the buffer */ 1491 + private int zzCurrentPos; 1492 + 1493 + /** startRead marks the beginning of the yytext() string in the buffer */ 1494 + private int zzStartRead; 1495 + 1496 + /** endRead marks the last character in the buffer, that has been read 1497 + from input */ 1498 + private int zzEndRead; 1499 + 1500 + /** number of newlines encountered up to the start of the matched text */ 1501 + private int yyline; 1502 + 1503 + /** the number of characters up to the start of the matched text */ 1504 + private int yychar; 1505 + 1506 + /** 1507 + * the number of characters from the last newline up to the start of the 1508 + * matched text 1509 + */ 1510 + private int yycolumn; 1511 + 1512 + /** 1513 + * zzAtBOL == true <=> the scanner is currently at the beginning of a line 1514 + */ 1515 + private bool zzAtBOL = true; 1516 + 1517 + /** zzAtEOF == true <=> the scanner is at the EOF */ 1518 + private bool zzAtEOF; 1519 + 1520 + 1521 + /** the stack of open (nested) input streams to read from */ 1522 + private System.Collections.Stack zzStreams = new System.Collections.Stack(); 1523 + 1524 + /** 1525 + * inner class used to store info for nested 1526 + * input streams 1527 + */ 1528 + private sealed class ZzFlexStreamInfo { 1529 + public System.IO.TextReader zzReader; 1530 + public int zzEndRead; 1531 + public int zzStartRead; 1532 + public int zzCurrentPos; 1533 + public int zzMarkedPos; 1534 + public int zzPushbackPos; 1535 + public int yyline; 1536 + public int yycolumn; 1537 + public char [] zzBuffer; 1538 + public bool zzAtEOF; 1539 + 1540 + /** sets all values stored in this class */ 1541 + public ZzFlexStreamInfo(System.IO.TextReader zzReader, int zzEndRead, int zzStartRead, 1542 + int zzCurrentPos, int zzMarkedPos, int zzPushbackPos, 1543 + char [] zzBuffer, bool zzAtEOF, int yyline, int yycolumn) { 1544 + this.zzReader = zzReader; 1545 + this.zzEndRead = zzEndRead; 1546 + this.zzStartRead = zzStartRead; 1547 + this.zzCurrentPos = zzCurrentPos; 1548 + this.zzMarkedPos = zzMarkedPos; 1549 + this.zzPushbackPos = zzPushbackPos; 1550 + this.zzBuffer = zzBuffer; 1551 + this.zzAtEOF = zzAtEOF; 1552 + this.yyline = yyline; 1553 + this.yycolumn = yycolumn; 1554 + } 1555 + } 1556 + 1557 + /** denotes if the user-EOF-code has already been executed */ 1558 + private bool zzEOFDone; 1559 + 1560 + /* user code: */ 1561 + internal int balance = 0; 1562 + internal int commentbalance = 0; 1563 + internal int action_line = 0; 1564 + internal int bufferSize = 16384; 1565 + 1566 + internal File file; 1567 + internal Stack files = new Stack(); 1568 + 1569 + internal StringBuilder userCode = new StringBuilder(); 1570 + internal StringBuilder epilogue = new StringBuilder(); 1571 + internal int epilogue_line = 0; 1572 + private bool epilogue_sent = false; 1573 + 1574 + internal String classCode; 1575 + internal String initCode; 1576 + internal String initThrow; 1577 + internal String eofCode; 1578 + internal String eofThrow; 1579 + internal String lexThrow; 1580 + internal String eofVal; 1581 + internal String scanErrorException; 1582 + internal String cupSymbol = "sym"; 1583 + 1584 + internal StringBuilder actionText = new StringBuilder(); 1585 + internal StringBuilder @string = new StringBuilder(); 1586 + 1587 + internal bool charCount; 1588 + internal bool lineCount; 1589 + internal bool columnCount; 1590 + internal bool cupCompatible; 1591 + internal bool cupDebug; 1592 + internal bool isInteger; 1593 + internal bool isIntWrap; 1594 + internal bool isYYEOF; 1595 + internal bool notUnix; 1596 + internal bool isPublic; 1597 + internal bool isFinal; 1598 + internal bool isAbstract; 1599 + internal bool lookAheadUsed; 1600 + internal bool bolUsed; 1601 + internal bool standalone; 1602 + internal bool debugOption; 1603 + internal bool useRowMap = Options.gen_method == Options.PACK || Options.gen_method == Options.TABLE; 1604 + internal bool packed = Options.gen_method == Options.PACK; 1605 + internal bool caseless; 1606 + internal bool inclusive_states; 1607 + internal bool eofclose; 1608 + 1609 + internal String isImplementing; 1610 + internal String isExtending; 1611 + internal String className = "Yylex"; 1612 + internal String functionName; 1613 + internal String tokenType; 1614 + internal String visibility = "public"; 1615 + 1616 + internal LexicalStates states = new LexicalStates(); 1617 + 1618 + internal ArrayList actions = new PrettyArrayList(); 1619 + 1620 + private int nextState; 1621 + 1622 + internal bool macroDefinition; 1623 + 1624 + internal Timer t = new Timer(); 1625 + 1626 + public int currentLine() { 1627 + return yyline; 1628 + } 1629 + 1630 + public void setFile(File file) { 1631 + this.file = file; 1632 + } 1633 + 1634 + private Symbol symbol(int type, Object value) { 1635 + return new Symbol(type, yyline, yycolumn, value); 1636 + } 1637 + 1638 + private Symbol symbol(int type) { 1639 + return new Symbol(type, yyline, yycolumn); 1640 + } 1641 + 1642 + // updates line and column count to the beginning of the first 1643 + // non whitespace character in yytext, but leaves yyline+yycolumn 1644 + // untouched 1645 + 1646 + private Symbol symbol_countUpdate(int type, Object value) { 1647 + int lc = yyline; 1648 + int cc = yycolumn; 1649 + String text = yytext(); 1650 + 1651 + for (int i=0; i < text.Length; i++) { 1652 + char c = text[i]; 1653 + 1654 + if (c != '\n' && c != '\r' && c != ' ' && c != '\t' ) 1655 + return new Symbol(type, lc, cc, value); 1656 + 1657 + if (c == '\n') { 1658 + lc++; 1659 + cc = 0; 1660 + } 1661 + else 1662 + cc++; 1663 + } 1664 + 1665 + return new Symbol(type, yyline, yycolumn, value); 1666 + } 1667 + 1668 + int yyline_copy, yycolumn_copy; 1669 + 1670 + private void updateCopyOfLineCount(String text) { 1671 + 1672 + yyline_copy = yyline; 1673 + yycolumn_copy = yycolumn; 1674 + 1675 + for (int i=0; i < text.Length; i++) { 1676 + char c = text[i]; 1677 + 1678 + if (c == '\n') { 1679 + yyline_copy++; 1680 + yycolumn_copy = 0; 1681 + } 1682 + else 1683 + yycolumn_copy++; 1684 + } 1685 + 1686 + } 1687 + 1688 + private String makeMacroIdent() { 1689 + String matched = yytext().Trim(); 1690 + return matched.Substring(1, matched.Length-2).Trim(); 1691 + } 1692 + 1693 + public static String conc(Object a, Object b) { 1694 + if (a == null && b == null) return null; 1695 + if (a == null) return b.ToString(); 1696 + if (b == null) return a.ToString(); 1697 + 1698 + return a.ToString()+b.ToString(); 1699 + } 1700 + 1701 + public static String concExc(Object a, Object b) { 1702 + if (a == null && b == null) return null; 1703 + if (a == null) return b.ToString(); 1704 + if (b == null) return a.ToString(); 1705 + 1706 + return a.ToString()+", "+b.ToString(); 1707 + } 1708 + 1709 + 1710 + /** 1711 + * Creates a new scanner 1712 + * There is also a System.IO.Stream version of this constructor. 1713 + * 1714 + * @param in the System.IO.TextReader to read input from. 1715 + */ 1716 + public LexScan(TextReader @in) { 1717 + states.insert("YYINITIAL", true); 1718 + this.zzReader = @in; 1719 + } 1720 + 1721 + /** 1722 + * Creates a new scanner. 1723 + * There is also TextReader version of this constructor. 1724 + * 1725 + * @param in the System.IO.Stream to read input from. 1726 + */ 1727 + public LexScan(Stream @in) : this(new StreamReader(@in)) 1728 + { 1729 + } 1730 + 1731 + /** 1732 + * Unpacks the compressed character translation table. 1733 + * 1734 + * @param packed the packed character translation table 1735 + * @return the unpacked character translation table 1736 + */ 1737 + private static char [] zzUnpackCMap(ushort[] packed) { 1738 + char [] map = new char[0x10000]; 1739 + int i = 0; /* index in packed string */ 1740 + int j = 0; /* index in unpacked array */ 1741 + while (i < 1594) { 1742 + int count = packed[i++]; 1743 + char value = (char)packed[i++]; 1744 + do map[j++] = value; while (--count > 0); 1745 + } 1746 + return map; 1747 + } 1748 + 1749 + 1750 + /** 1751 + * Refills the input buffer. 1752 + * 1753 + * @return <code>false</code>, iff there was new input. 1754 + * 1755 + * @exception System.IO.IOException if any I/O-Error occurs 1756 + */ 1757 + private bool zzRefill() { 1758 + 1759 + /* first: make room (if you can) */ 1760 + if (zzStartRead > 0) { 1761 + Array.Copy(zzBuffer, zzStartRead, 1762 + zzBuffer, 0, 1763 + zzEndRead-zzStartRead); 1764 + 1765 + /* translate stored positions */ 1766 + zzEndRead-= zzStartRead; 1767 + zzCurrentPos-= zzStartRead; 1768 + zzMarkedPos-= zzStartRead; 1769 + zzPushbackPos-= zzStartRead; 1770 + zzStartRead = 0; 1771 + } 1772 + 1773 + /* is the buffer big enough? */ 1774 + if (zzCurrentPos >= zzBuffer.Length) { 1775 + /* if not: blow it up */ 1776 + char[] newBuffer = new char[zzCurrentPos*2]; 1777 + Array.Copy(zzBuffer, 0, newBuffer, 0, zzBuffer.Length); 1778 + zzBuffer = newBuffer; 1779 + } 1780 + 1781 + /* finally: fill the buffer with new input */ 1782 + int numRead = zzReader.Read(zzBuffer, zzEndRead, 1783 + zzBuffer.Length-zzEndRead); 1784 + 1785 + if (numRead <= 0) { 1786 + return true; 1787 + } 1788 + else { 1789 + zzEndRead+= numRead; 1790 + return false; 1791 + } 1792 + } 1793 + 1794 + 1795 + /** 1796 + * Closes the input stream. 1797 + */ 1798 + public void yyclose() { 1799 + zzAtEOF = true; /* indicate end of file */ 1800 + zzEndRead = zzStartRead; /* invalidate buffer */ 1801 + 1802 + if (zzReader != null) 1803 + zzReader.Close(); 1804 + } 1805 + 1806 + 1807 + /** 1808 + * Stores the current input stream on a stack, and 1809 + * reads from a new stream. Lexical state, line, 1810 + * char, and column counting remain untouched. 1811 + * 1812 + * The current input stream can be restored with 1813 + * yypopstream (usually in an <<EOF>> action). 1814 + * 1815 + * @param reader the new input stream to read from 1816 + * 1817 + * @see #yypopStream() 1818 + */ 1819 + public void yypushStream(TextReader reader) { 1820 + zzStreams.Push( 1821 + new ZzFlexStreamInfo(zzReader, zzEndRead, zzStartRead, zzCurrentPos, 1822 + zzMarkedPos, zzPushbackPos, zzBuffer, zzAtEOF, 1823 + yyline, yycolumn) 1824 + ); 1825 + zzAtEOF = false; 1826 + zzBuffer = new char[ZZ_BUFFERSIZE]; 1827 + zzReader = reader; 1828 + zzEndRead = zzStartRead = 0; 1829 + zzCurrentPos = zzMarkedPos = zzPushbackPos = 0; 1830 + yyline = yycolumn = 0; 1831 + } 1832 + 1833 + 1834 + /** 1835 + * Closes the current input stream and continues to 1836 + * read from the one on top of the stream stack. 1837 + * 1838 + * @throws System.InvalidOperationException 1839 + * if there is no further stream to read from. 1840 + * 1841 + * @throws System.IO.IOException 1842 + * if there was an error in closing the stream. 1843 + * 1844 + * @see #yypushStream(TextReader) 1845 + */ 1846 + public void yypopStream() { 1847 + zzReader.Close(); 1848 + ZzFlexStreamInfo s = (ZzFlexStreamInfo) zzStreams.Pop(); 1849 + zzBuffer = s.zzBuffer; 1850 + zzReader = s.zzReader; 1851 + zzEndRead = s.zzEndRead; 1852 + zzStartRead = s.zzStartRead; 1853 + zzCurrentPos = s.zzCurrentPos; 1854 + zzMarkedPos = s.zzMarkedPos ; 1855 + zzPushbackPos = s.zzPushbackPos; 1856 + zzAtEOF = s.zzAtEOF; 1857 + yyline = s.yyline; 1858 + yycolumn = s.yycolumn; 1859 + } 1860 + 1861 + 1862 + /** 1863 + * Returns true iff there are still streams left 1864 + * to read from on the stream stack. 1865 + */ 1866 + public bool yymoreStreams() { 1867 + return zzStreams.Count != 0; 1868 + } 1869 + 1870 + 1871 + /** 1872 + * Resets the scanner to read from a new input stream. 1873 + * Does not close the old reader. 1874 + * 1875 + * All internal variables are reset, the old input stream 1876 + * <b>cannot</b> be reused (internal buffer is discarded and lost). 1877 + * Lexical state is set to <tt>ZZ_INITIAL</tt>. 1878 + * 1879 + * @param reader the new input stream 1880 + * 1881 + * @see #yypushStream(System.IO.TextReader) 1882 + * @see #yypopStream() 1883 + */ 1884 + public void yyreset(System.IO.TextReader reader) { 1885 + zzReader = reader; 1886 + zzAtBOL = true; 1887 + zzAtEOF = false; 1888 + zzEndRead = zzStartRead = 0; 1889 + zzCurrentPos = zzMarkedPos = zzPushbackPos = 0; 1890 + yyline = yychar = yycolumn = 0; 1891 + zzLexicalState = YYINITIAL; 1892 + } 1893 + 1894 + 1895 + /** 1896 + * Returns the current lexical state. 1897 + */ 1898 + public int yystate() { 1899 + return zzLexicalState; 1900 + } 1901 + 1902 + 1903 + /** 1904 + * Enters a new lexical state 1905 + * 1906 + * @param newState the new lexical state 1907 + */ 1908 + public void yybegin(int newState) { 1909 + zzLexicalState = newState; 1910 + } 1911 + 1912 + 1913 + /** 1914 + * Returns the text matched by the current regular expression. 1915 + */ 1916 + public String yytext() { 1917 + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); 1918 + } 1919 + 1920 + 1921 + /** 1922 + * Returns the character at position <tt>pos</tt> from the 1923 + * matched text. 1924 + * 1925 + * It is equivalent to yytext().charAt(pos), but faster 1926 + * 1927 + * @param pos the position of the character to fetch. 1928 + * A value from 0 to yylength()-1. 1929 + * 1930 + * @return the character at position pos 1931 + */ 1932 + public char yycharat(int pos) { 1933 + return zzBuffer[zzStartRead+pos]; 1934 + } 1935 + 1936 + 1937 + /** 1938 + * Returns the length of the matched text region. 1939 + */ 1940 + public int yylength() { 1941 + return zzMarkedPos-zzStartRead; 1942 + } 1943 + 1944 + 1945 + /** 1946 + * Reports an error that occured while scanning. 1947 + * 1948 + * In a wellformed scanner (no or only correct usage of 1949 + * yypushback(int) and a match-all fallback rule) this method 1950 + * will only be called with things that "Can't Possibly Happen". 1951 + * If this method is called, something is seriously wrong 1952 + * (e.g. a JFlex/CSFlex bug producing a faulty scanner etc.). 1953 + * 1954 + * Usual syntax/scanner level error handling should be done 1955 + * in error fallback rules. 1956 + * 1957 + * @param errorCode the code of the errormessage to display 1958 + */ 1959 + private void zzScanError(int errorCode) { 1960 + String message; 1961 + try { 1962 + message = ZZ_ERROR_MSG[errorCode]; 1963 + } 1964 + catch (IndexOutOfRangeException) { 1965 + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; 1966 + } 1967 + 1968 + throw new Exception(message); 1969 + } 1970 + 1971 + 1972 + /** 1973 + * Pushes the specified amount of characters back into the input stream. 1974 + * 1975 + * They will be read again by then next call of the scanning method 1976 + * 1977 + * @param number the number of characters to be read again. 1978 + * This number must not be greater than yylength()! 1979 + */ 1980 + public void yypushback(int number) { 1981 + if ( number > yylength() ) 1982 + zzScanError(ZZ_PUSHBACK_2BIG); 1983 + 1984 + zzMarkedPos -= number; 1985 + } 1986 + 1987 + 1988 + /** 1989 + * Contains user EOF-code, which will be executed exactly once, 1990 + * when the end of file is reached 1991 + */ 1992 + private void zzDoEOF() { 1993 + if (!zzEOFDone) { 1994 + zzEOFDone = true; 1995 + yyclose(); 1996 + } 1997 + } 1998 + 1999 + 2000 + /** 2001 + * Resumes scanning until the next regular expression is matched, 2002 + * the end of input is encountered or an I/O-Error occurs. 2003 + * 2004 + * @return the next token 2005 + * @exception System.IO.IOException if any I/O-Error occurs 2006 + */ 2007 + public Symbol next_token() { 2008 + int zzInput = 0; 2009 + int zzAction; 2010 + 2011 + int [] zzTransL = ZZ_TRANS; 2012 + int [] zzRowMapL = ZZ_ROWMAP; 2013 + int [] zzAttrL = ZZ_ATTRIBUTE; 2014 + int zzPushbackPosL = zzPushbackPos = -1; 2015 + bool zzWasPushback; 2016 + 2017 + while (true) { 2018 + // cached fields: 2019 + int zzCurrentPosL; 2020 + int zzMarkedPosL = zzMarkedPos; 2021 + int zzEndReadL = zzEndRead; 2022 + char [] zzBufferL = zzBuffer; 2023 + char [] zzCMapL = ZZ_CMAP; 2024 + 2025 + bool zzR = false; 2026 + for (zzCurrentPosL = zzStartRead; zzCurrentPosL < zzMarkedPosL; 2027 + zzCurrentPosL++) { 2028 + switch (zzBufferL[zzCurrentPosL]) { 2029 + case '\u000B': 2030 + case '\u000C': 2031 + case '\u0085': 2032 + case '\u2028': 2033 + case '\u2029': 2034 + yyline++; 2035 + yycolumn = 0; 2036 + zzR = false; 2037 + break; 2038 + case '\r': 2039 + yyline++; 2040 + yycolumn = 0; 2041 + zzR = true; 2042 + break; 2043 + case '\n': 2044 + if (zzR) 2045 + zzR = false; 2046 + else { 2047 + yyline++; 2048 + yycolumn = 0; 2049 + } 2050 + break; 2051 + default: 2052 + zzR = false; 2053 + yycolumn++; 2054 + break; 2055 + } 2056 + } 2057 + 2058 + if (zzR) { 2059 + // peek one character ahead if it is \n (if we have counted one line too much) 2060 + bool zzPeek; 2061 + if (zzMarkedPosL < zzEndReadL) 2062 + zzPeek = zzBufferL[zzMarkedPosL] == '\n'; 2063 + else if (zzAtEOF) 2064 + zzPeek = false; 2065 + else { 2066 + bool eof = zzRefill(); 2067 + zzMarkedPosL = zzMarkedPos; 2068 + zzBufferL = zzBuffer; 2069 + if (eof) 2070 + zzPeek = false; 2071 + else 2072 + zzPeek = zzBufferL[zzMarkedPosL] == '\n'; 2073 + } 2074 + if (zzPeek) yyline--; 2075 + } 2076 + if (zzMarkedPosL > zzStartRead) { 2077 + switch (zzBufferL[zzMarkedPosL-1]) { 2078 + case '\n': 2079 + case '\u000B': 2080 + case '\u000C': 2081 + case '\u0085': 2082 + case '\u2028': 2083 + case '\u2029': 2084 + zzAtBOL = true; 2085 + break; 2086 + case '\r': 2087 + if (zzMarkedPosL < zzEndReadL) 2088 + zzAtBOL = zzBufferL[zzMarkedPosL] != '\n'; 2089 + else if (zzAtEOF) 2090 + zzAtBOL = false; 2091 + else { 2092 + bool eof = zzRefill(); 2093 + zzMarkedPosL = zzMarkedPos; 2094 + zzBufferL = zzBuffer; 2095 + if (eof) 2096 + zzAtBOL = false; 2097 + else 2098 + zzAtBOL = zzBufferL[zzMarkedPosL] != '\n'; 2099 + } 2100 + break; 2101 + default: 2102 + zzAtBOL = false; 2103 + break; 2104 + } 2105 + } 2106 + zzAction = -1; 2107 + 2108 + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; 2109 + 2110 + if (zzAtBOL) 2111 + zzState = ZZ_LEXSTATE[zzLexicalState+1]; 2112 + else 2113 + zzState = ZZ_LEXSTATE[zzLexicalState]; 2114 + 2115 + zzWasPushback = false; 2116 + 2117 + while (true) { 2118 + goto zzForAction_skip; 2119 + zzForAction: break; 2120 + zzForAction_skip: 2121 + if (!ZZ_SPURIOUS_WARNINGS_SUCK) goto zzForAction; 2122 + 2123 + if (zzCurrentPosL < zzEndReadL) 2124 + zzInput = zzBufferL[zzCurrentPosL++]; 2125 + else if (zzAtEOF) { 2126 + zzInput = YYEOF; 2127 + goto zzForAction; 2128 + } 2129 + else { 2130 + // store back cached positions 2131 + zzCurrentPos = zzCurrentPosL; 2132 + zzMarkedPos = zzMarkedPosL; 2133 + zzPushbackPos = zzPushbackPosL; 2134 + bool eof = zzRefill(); 2135 + // get translated positions and possibly new buffer 2136 + zzCurrentPosL = zzCurrentPos; 2137 + zzMarkedPosL = zzMarkedPos; 2138 + zzBufferL = zzBuffer; 2139 + zzEndReadL = zzEndRead; 2140 + zzPushbackPosL = zzPushbackPos; 2141 + if (eof) { 2142 + zzInput = YYEOF; 2143 + goto zzForAction; 2144 + } 2145 + else { 2146 + zzInput = zzBufferL[zzCurrentPosL++]; 2147 + } 2148 + } 2149 + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; 2150 + if (zzNext == -1) goto zzForAction; 2151 + zzState = zzNext; 2152 + 2153 + int zzAttributes = zzAttrL[zzState]; 2154 + if ( (zzAttributes & 2) == 2 ) 2155 + zzPushbackPosL = zzCurrentPosL; 2156 + 2157 + if ( (zzAttributes & 1) == 1 ) { 2158 + zzWasPushback = (zzAttributes & 4) == 4; 2159 + zzAction = zzState; 2160 + zzMarkedPosL = zzCurrentPosL; 2161 + if ( (zzAttributes & 8) == 8 ) goto zzForAction; 2162 + } 2163 + 2164 + } 2165 + 2166 + // store back cached position 2167 + zzMarkedPos = zzMarkedPosL; 2168 + if (zzWasPushback) 2169 + zzMarkedPos = zzPushbackPosL; 2170 + 2171 + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { 2172 + case 140: 2173 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2174 + { 2175 + #line 372 "LexScan.flex" 2176 + throw new ScannerException(file,ErrorMessages.QUIL_EOFTHROW, yyline); 2177 + #line default 2178 + } 2179 + break; 2180 + case 54: 2181 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2182 + { 2183 + #line 622 "LexScan.flex" 2184 + throw new ScannerException(file,ErrorMessages.UNEXPECTED_NL, yyline, yycolumn); 2185 + #line default 2186 + } 2187 + break; 2188 + case 128: 2189 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2190 + { 2191 + #line 350 "LexScan.flex" 2192 + File f = new File(yytext().Substring(9).Trim()); 2193 + if ( !f.canRead() ) 2194 + throw new ScannerException(file,ErrorMessages.NOT_READABLE, yyline); 2195 + // check for cycle 2196 + // FIXME: this is an extremely ugly hack for the C# version 2197 + if (new ArrayList(files.ToArray()).Contains(f)) 2198 + throw new ScannerException(file,ErrorMessages.FILE_CYCLE, yyline); 2199 + try { 2200 + yypushStream( new StreamReader(f) ); 2201 + files.Push(file); 2202 + file = f; 2203 + Out.println("Including \""+file+"\""); 2204 + } 2205 + catch (FileNotFoundException) { 2206 + throw new ScannerException(file,ErrorMessages.NOT_READABLE, yyline); 2207 + } 2208 + 2209 + #line default 2210 + } 2211 + break; 2212 + case 2: 2213 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2214 + { 2215 + #line 616 "LexScan.flex" 2216 + /* ignore */ 2217 + #line default 2218 + } 2219 + break; 2220 + case 30: 2221 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2222 + { 2223 + #line 463 "LexScan.flex" 2224 + return symbol(CLOSEBRACKET); 2225 + #line default 2226 + } 2227 + break; 2228 + case 129: 2229 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2230 + { 2231 + #line 374 "LexScan.flex" 2232 + lexThrow = concExc(lexThrow,yytext().Substring(8).Trim()); 2233 + #line default 2234 + } 2235 + break; 2236 + case 132: 2237 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2238 + { 2239 + #line 322 "LexScan.flex" 2240 + cupSymbol = yytext().Substring(8).Trim(); 2241 + if (cupCompatible) Out.warning(ErrorMessages.CUPSYM_AFTER_CUP, yyline); 2242 + #line default 2243 + } 2244 + break; 2245 + case 51: 2246 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2247 + { 2248 + #line 517 "LexScan.flex" 2249 + return symbol(DASH); 2250 + #line default 2251 + } 2252 + break; 2253 + case 66: 2254 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2255 + { 2256 + #line 410 "LexScan.flex" 2257 + 2258 + #line default 2259 + } 2260 + break; 2261 + case 27: 2262 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2263 + { 2264 + #line 460 "LexScan.flex" 2265 + return symbol(BANG); 2266 + #line default 2267 + } 2268 + break; 2269 + case 143: 2270 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2271 + { 2272 + #line 371 "LexScan.flex" 2273 + eofThrow = concExc(eofThrow,yytext().Substring(10).Trim()); 2274 + #line default 2275 + } 2276 + break; 2277 + case 81: 2278 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2279 + { 2280 + #line 534 "LexScan.flex" 2281 + @string.Append('\"'); 2282 + #line default 2283 + } 2284 + break; 2285 + case 10: 2286 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2287 + { 2288 + #line 394 "LexScan.flex" 2289 + 2290 + #line default 2291 + } 2292 + break; 2293 + case 136: 2294 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2295 + { 2296 + #line 493 "LexScan.flex" 2297 + return symbol(DIGITCLASS); 2298 + #line default 2299 + } 2300 + break; 2301 + case 127: 2302 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2303 + { 2304 + #line 412 "LexScan.flex" 2305 + actionText.Length = 0; yybegin(JAVA_CODE); 2306 + updateCopyOfLineCount(yytext()); 2307 + action_line = yyline_copy + 1; 2308 + actionText.Append(new string(' ', yycolumn_copy)); 2309 + return symbol_countUpdate(EOFRULE, null); 2310 + #line default 2311 + } 2312 + break; 2313 + case 150: 2314 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2315 + { 2316 + #line 369 "LexScan.flex" 2317 + initThrow = concExc(initThrow,yytext().Substring(11).Trim()); 2318 + #line default 2319 + } 2320 + break; 2321 + case 33: 2322 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2323 + { 2324 + #line 467 "LexScan.flex" 2325 + lookAheadUsed = true; return symbol(DOLLAR); 2326 + #line default 2327 + } 2328 + break; 2329 + case 26: 2330 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2331 + { 2332 + #line 457 "LexScan.flex" 2333 + return symbol(BAR); 2334 + #line default 2335 + } 2336 + break; 2337 + case 22: 2338 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2339 + { 2340 + #line 464 "LexScan.flex" 2341 + return symbol(STAR); 2342 + #line default 2343 + } 2344 + break; 2345 + case 97: 2346 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2347 + { 2348 + #line 280 "LexScan.flex" 2349 + classCode = conc(classCode,@string); yybegin(MACROS); 2350 + #line default 2351 + } 2352 + break; 2353 + case 14: 2354 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2355 + { 2356 + #line 407 "LexScan.flex" 2357 + yybegin(REGEXP); 2358 + #line default 2359 + } 2360 + break; 2361 + case 155: 2362 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2363 + { 2364 + #line 373 "LexScan.flex" 2365 + lexThrow = concExc(lexThrow,yytext().Substring(12).Trim()); 2366 + #line default 2367 + } 2368 + break; 2369 + case 124: 2370 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2371 + { 2372 + #line 324 "LexScan.flex" 2373 + throw new ScannerException(file,ErrorMessages.QUIL_CUPSYM, yyline); 2374 + #line default 2375 + } 2376 + break; 2377 + case 156: 2378 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2379 + { 2380 + #line 494 "LexScan.flex" 2381 + return symbol(UPPERCLASS); 2382 + #line default 2383 + } 2384 + break; 2385 + case 49: 2386 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2387 + { 2388 + #line 523 "LexScan.flex" 2389 + @string.Length = 0; nextState = CHARCLASS; yybegin(STRING_CONTENT); 2390 + #line default 2391 + } 2392 + break; 2393 + case 83: 2394 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2395 + { 2396 + #line 545 "LexScan.flex" 2397 + @string.Append('\t'); 2398 + #line default 2399 + } 2400 + break; 2401 + case 20: 2402 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2403 + { 2404 + #line 469 "LexScan.flex" 2405 + return symbol(POINT); 2406 + #line default 2407 + } 2408 + break; 2409 + case 40: 2410 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2411 + { 2412 + #line 426 "LexScan.flex" 2413 + return symbol(COMMA); 2414 + #line default 2415 + } 2416 + break; 2417 + case 135: 2418 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2419 + { 2420 + #line 367 "LexScan.flex" 2421 + bufferSize = Integer.parseInt(yytext().Substring(8).Trim()); 2422 + #line default 2423 + } 2424 + break; 2425 + case 79: 2426 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2427 + { 2428 + #line 549 "LexScan.flex" 2429 + @string.Append(yytext()[1]); 2430 + #line default 2431 + } 2432 + break; 2433 + case 74: 2434 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2435 + { 2436 + #line 476 "LexScan.flex" 2437 + actionText.Length = 0; yybegin(JAVA_CODE); 2438 + updateCopyOfLineCount(yytext()); 2439 + action_line = yyline_copy + 1; 2440 + actionText.Append(new string(' ', yycolumn_copy)); 2441 + return symbol(REGEXPEND); 2442 + #line default 2443 + } 2444 + break; 2445 + case 154: 2446 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2447 + { 2448 + #line 282 "LexScan.flex" 2449 + initThrow = concExc(initThrow,@string); yybegin(MACROS); 2450 + #line default 2451 + } 2452 + break; 2453 + case 41: 2454 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2455 + { 2456 + #line 430 "LexScan.flex" 2457 + yybegin(REGEXP); return symbol(MORETHAN); 2458 + #line default 2459 + } 2460 + break; 2461 + case 120: 2462 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2463 + { 2464 + #line 281 "LexScan.flex" 2465 + initCode = conc(initCode,@string); yybegin(MACROS); 2466 + #line default 2467 + } 2468 + break; 2469 + case 116: 2470 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2471 + { 2472 + #line 306 "LexScan.flex" 2473 + columnCount = true; 2474 + #line default 2475 + } 2476 + break; 2477 + case 16: 2478 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2479 + { 2480 + #line 408 "LexScan.flex" 2481 + yybegin(STATES); return symbol_countUpdate(LESSTHAN, null); 2482 + #line default 2483 + } 2484 + break; 2485 + case 138: 2486 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2487 + { 2488 + #line 286 "LexScan.flex" 2489 + eofVal = @string.ToString(); yybegin(MACROS); 2490 + #line default 2491 + } 2492 + break; 2493 + case 50: 2494 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2495 + { 2496 + #line 516 "LexScan.flex" 2497 + return symbol(HAT); 2498 + #line default 2499 + } 2500 + break; 2501 + case 73: 2502 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2503 + { 2504 + #line 560 "LexScan.flex" 2505 + return symbol(CHAR, '\b'); 2506 + #line default 2507 + } 2508 + break; 2509 + case 159: 2510 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2511 + { 2512 + #line 327 "LexScan.flex" 2513 + eofclose = false; 2514 + #line default 2515 + } 2516 + break; 2517 + case 115: 2518 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2519 + { 2520 + #line 347 "LexScan.flex" 2521 + packed = false; useRowMap = false; 2522 + #line default 2523 + } 2524 + break; 2525 + case 44: 2526 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2527 + { 2528 + #line 533 "LexScan.flex" 2529 + yybegin(nextState); return symbol(STRING, @string.ToString()); 2530 + #line default 2531 + } 2532 + break; 2533 + case 122: 2534 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2535 + { 2536 + #line 334 "LexScan.flex" 2537 + notUnix = true; 2538 + #line default 2539 + } 2540 + break; 2541 + case 113: 2542 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2543 + { 2544 + #line 283 "LexScan.flex" 2545 + eofCode = conc(eofCode,@string); yybegin(MACROS); 2546 + #line default 2547 + } 2548 + break; 2549 + case 108: 2550 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2551 + { 2552 + #line 348 "LexScan.flex" 2553 + packed = false; useRowMap = true; 2554 + #line default 2555 + } 2556 + break; 2557 + case 148: 2558 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2559 + { 2560 + #line 490 "LexScan.flex" 2561 + return symbol(JLETTERCLASS); 2562 + #line default 2563 + } 2564 + break; 2565 + case 87: 2566 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2567 + { 2568 + #line 521 "LexScan.flex" 2569 + yypushback(1); yycolumn--; return symbol(CHAR, yytext()[0]); 2570 + #line default 2571 + } 2572 + break; 2573 + case 62: 2574 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2575 + { 2576 + #line 390 "LexScan.flex" 2577 + throw new ScannerException(file,ErrorMessages.UNKNOWN_OPTION, yyline, yycolumn); 2578 + #line default 2579 + } 2580 + break; 2581 + case 126: 2582 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2583 + { 2584 + #line 368 "LexScan.flex" 2585 + throw new ScannerException(file,ErrorMessages.NO_BUFFER_SIZE, yyline); 2586 + #line default 2587 + } 2588 + break; 2589 + case 37: 2590 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2591 + { 2592 + #line 589 "LexScan.flex" 2593 + balance++; actionText.Append('{'); 2594 + #line default 2595 + } 2596 + break; 2597 + case 15: 2598 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2599 + { 2600 + #line 409 "LexScan.flex" 2601 + return symbol_countUpdate(RBRACE, null); 2602 + #line default 2603 + } 2604 + break; 2605 + case 137: 2606 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2607 + { 2608 + #line 437 "LexScan.flex" 2609 + actionText.Length = 0; yybegin(JAVA_CODE); 2610 + updateCopyOfLineCount(yytext()); 2611 + action_line = yyline_copy + 1; 2612 + actionText.Append(new string(' ', yycolumn_copy)); 2613 + return symbol(EOFRULE); 2614 + #line default 2615 + } 2616 + break; 2617 + case 4: 2618 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2619 + { 2620 + #line 273 "LexScan.flex" 2621 + userCode.Append(yytext()); 2622 + #line default 2623 + } 2624 + break; 2625 + case 55: 2626 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2627 + { 2628 + #line 505 "LexScan.flex" 2629 + yybegin(REGEXP); return symbol(RBRACE); 2630 + #line default 2631 + } 2632 + break; 2633 + case 106: 2634 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2635 + { 2636 + #line 349 "LexScan.flex" 2637 + packed = true; useRowMap = true; 2638 + #line default 2639 + } 2640 + break; 2641 + case 142: 2642 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2643 + { 2644 + #line 370 "LexScan.flex" 2645 + throw new ScannerException(file,ErrorMessages.QUIL_INITTHROW, yyline); 2646 + #line default 2647 + } 2648 + break; 2649 + case 24: 2650 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2651 + { 2652 + #line 459 "LexScan.flex" 2653 + @string.Length = 0; nextState = REGEXP; yybegin(STRING_CONTENT); 2654 + #line default 2655 + } 2656 + break; 2657 + case 11: 2658 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2659 + { 2660 + #line 395 "LexScan.flex" 2661 + 2662 + #line default 2663 + } 2664 + break; 2665 + case 25: 2666 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2667 + { 2668 + #line 455 "LexScan.flex" 2669 + yybegin(REGEXPSTART); return symbol(LBRACE); 2670 + #line default 2671 + } 2672 + break; 2673 + case 68: 2674 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2675 + { 2676 + #line 558 "LexScan.flex" 2677 + return symbol(CHAR, (char) Integer.parseInt(yytext().Substring(1,yytext().Length-1), 8)); 2678 + #line default 2679 + } 2680 + break; 2681 + case 29: 2682 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2683 + { 2684 + #line 462 "LexScan.flex" 2685 + return symbol(OPENBRACKET); 2686 + #line default 2687 + } 2688 + break; 2689 + case 85: 2690 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2691 + { 2692 + #line 546 "LexScan.flex" 2693 + @string.Append('\f'); 2694 + #line default 2695 + } 2696 + break; 2697 + case 86: 2698 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2699 + { 2700 + #line 543 "LexScan.flex" 2701 + @string.Append('\b'); 2702 + #line default 2703 + } 2704 + break; 2705 + case 64: 2706 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2707 + { 2708 + #line 389 "LexScan.flex" 2709 + macroDefinition = false; yybegin(REGEXPSTART); return symbol(DELIMITER); 2710 + #line default 2711 + } 2712 + break; 2713 + case 121: 2714 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2715 + { 2716 + #line 332 "LexScan.flex" 2717 + isIntWrap = true; 2718 + #line default 2719 + } 2720 + break; 2721 + case 70: 2722 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2723 + { 2724 + #line 562 "LexScan.flex" 2725 + return symbol(CHAR, '\t'); 2726 + #line default 2727 + } 2728 + break; 2729 + case 57: 2730 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2731 + { 2732 + #line 571 "LexScan.flex" 2733 + epilogue.Append(yytext()); 2734 + #line default 2735 + } 2736 + break; 2737 + case 101: 2738 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2739 + { 2740 + #line 556 "LexScan.flex" 2741 + return symbol(CHAR, (char) Integer.parseInt(yytext().Substring(2,yytext().Length-2), 16)); 2742 + #line default 2743 + } 2744 + break; 2745 + case 146: 2746 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2747 + { 2748 + #line 346 "LexScan.flex" 2749 + standalone = true; isInteger = true; 2750 + #line default 2751 + } 2752 + break; 2753 + case 69: 2754 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2755 + { 2756 + #line 561 "LexScan.flex" 2757 + return symbol(CHAR, '\n'); 2758 + #line default 2759 + } 2760 + break; 2761 + case 130: 2762 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2763 + { 2764 + #line 326 "LexScan.flex" 2765 + eofclose = true; 2766 + #line default 2767 + } 2768 + break; 2769 + case 46: 2770 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2771 + { 2772 + #line 527 "LexScan.flex" 2773 + throw new ScannerException(file,ErrorMessages.EOL_IN_CHARCLASS,yyline,yycolumn); 2774 + #line default 2775 + } 2776 + break; 2777 + case 125: 2778 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2779 + { 2780 + #line 328 "LexScan.flex" 2781 + className = yytext().Substring(7).Trim(); 2782 + #line default 2783 + } 2784 + break; 2785 + case 103: 2786 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2787 + { 2788 + #line 336 "LexScan.flex" 2789 + return symbol(FULL); 2790 + #line default 2791 + } 2792 + break; 2793 + case 1: 2794 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2795 + { 2796 + #line 274 "LexScan.flex" 2797 + return symbol(EOF); 2798 + #line default 2799 + } 2800 + break; 2801 + case 61: 2802 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2803 + { 2804 + #line 383 "LexScan.flex" 2805 + nextState = MACROS; yybegin(COMMENT); 2806 + #line default 2807 + } 2808 + break; 2809 + case 96: 2810 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2811 + { 2812 + #line 513 "LexScan.flex" 2813 + return symbol(MACROUSE, yytext().Substring(1,yytext().Length-2)); 2814 + #line default 2815 + } 2816 + break; 2817 + case 45: 2818 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2819 + { 2820 + #line 525 "LexScan.flex" 2821 + return symbol(CHAR, yytext()[0]); 2822 + #line default 2823 + } 2824 + break; 2825 + case 52: 2826 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2827 + { 2828 + #line 288 "LexScan.flex" 2829 + @string.Append(yytext()); 2830 + #line default 2831 + } 2832 + break; 2833 + case 76: 2834 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2835 + { 2836 + #line 485 "LexScan.flex" 2837 + 2838 + #line default 2839 + } 2840 + break; 2841 + case 18: 2842 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2843 + { 2844 + #line 487 "LexScan.flex" 2845 + 2846 + #line default 2847 + } 2848 + break; 2849 + case 93: 2850 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2851 + { 2852 + #line 557 "LexScan.flex" 2853 + return symbol(CHAR, (char) Integer.parseInt(yytext().Substring(2,yytext().Length-2), 16)); 2854 + #line default 2855 + } 2856 + break; 2857 + case 56: 2858 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2859 + { 2860 + #line 501 "LexScan.flex" 2861 + yybegin(REGEXP); 2862 + #line default 2863 + } 2864 + break; 2865 + case 80: 2866 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2867 + { 2868 + #line 541 "LexScan.flex" 2869 + @string.Append( (char) Integer.parseInt(yytext().Substring(1,yytext().Length-1), 8)); 2870 + #line default 2871 + } 2872 + break; 2873 + case 91: 2874 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2875 + { 2876 + #line 295 "LexScan.flex" 2877 + inclusive_states = false; yybegin(STATELIST); 2878 + #line default 2879 + } 2880 + break; 2881 + case 88: 2882 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2883 + { 2884 + #line 506 "LexScan.flex" 2885 + return symbol(REPEAT, int.Parse(yytext().Substring(1).Trim())); 2886 + #line default 2887 + } 2888 + break; 2889 + case 42: 2890 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2891 + { 2892 + #line 535 "LexScan.flex" 2893 + @string.Append(yytext()); 2894 + #line default 2895 + } 2896 + break; 2897 + case 102: 2898 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2899 + { 2900 + #line 539 "LexScan.flex" 2901 + @string.Append( (char) Integer.parseInt(yytext().Substring(2,yytext().Length-2), 16)); 2902 + #line default 2903 + } 2904 + break; 2905 + case 58: 2906 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2907 + { 2908 + #line 267 "LexScan.flex" 2909 + 2910 + t.start(); 2911 + yybegin(MACROS); 2912 + macroDefinition = true; 2913 + return symbol(USERCODE, userCode); 2914 + 2915 + #line default 2916 + } 2917 + break; 2918 + case 72: 2919 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2920 + { 2921 + #line 563 "LexScan.flex" 2922 + return symbol(CHAR, '\f'); 2923 + #line default 2924 + } 2925 + break; 2926 + case 139: 2927 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2928 + { 2929 + #line 340 "LexScan.flex" 2930 + isExtending = yytext().Substring(9).Trim(); 2931 + #line default 2932 + } 2933 + break; 2934 + case 19: 2935 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2936 + { 2937 + #line 481 "LexScan.flex" 2938 + if (macroDefinition) { yybegin(MACROS); } return symbol(REGEXPEND); 2939 + #line default 2940 + } 2941 + break; 2942 + case 144: 2943 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2944 + { 2945 + #line 329 "LexScan.flex" 2946 + functionName = yytext().Substring(10).Trim(); 2947 + #line default 2948 + } 2949 + break; 2950 + case 105: 2951 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2952 + { 2953 + #line 304 "LexScan.flex" 2954 + charCount = true; 2955 + #line default 2956 + } 2957 + break; 2958 + case 90: 2959 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2960 + { 2961 + #line 278 "LexScan.flex" 2962 + @string.Length = 0; yybegin(COPY); 2963 + #line default 2964 + } 2965 + break; 2966 + case 147: 2967 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2968 + { 2969 + #line 378 "LexScan.flex" 2970 + throw new ScannerException(file,ErrorMessages.QUIL_SCANERROR, yyline); 2971 + #line default 2972 + } 2973 + break; 2974 + case 82: 2975 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2976 + { 2977 + #line 544 "LexScan.flex" 2978 + @string.Append('\n'); 2979 + #line default 2980 + } 2981 + break; 2982 + case 152: 2983 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2984 + { 2985 + #line 375 "LexScan.flex" 2986 + throw new ScannerException(file,ErrorMessages.QUIL_YYLEXTHROW, yyline); 2987 + #line default 2988 + } 2989 + break; 2990 + case 67: 2991 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 2992 + { 2993 + #line 566 "LexScan.flex" 2994 + return symbol(CHAR, yytext()[1]); 2995 + #line default 2996 + } 2997 + break; 2998 + case 111: 2999 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3000 + { 3001 + #line 345 "LexScan.flex" 3002 + debugOption = true; 3003 + #line default 3004 + } 3005 + break; 3006 + case 145: 3007 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3008 + { 3009 + #line 342 "LexScan.flex" 3010 + visibility = "private"; Skeleton.makePrivate(); 3011 + #line default 3012 + } 3013 + break; 3014 + case 75: 3015 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3016 + { 3017 + #line 483 "LexScan.flex" 3018 + nextState = REGEXP; yybegin(COMMENT); 3019 + #line default 3020 + } 3021 + break; 3022 + case 39: 3023 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3024 + { 3025 + #line 427 "LexScan.flex" 3026 + 3027 + #line default 3028 + } 3029 + break; 3030 + case 98: 3031 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3032 + { 3033 + #line 331 "LexScan.flex" 3034 + isInteger = true; 3035 + #line default 3036 + } 3037 + break; 3038 + case 89: 3039 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3040 + { 3041 + #line 385 "LexScan.flex" 3042 + 3043 + #line default 3044 + } 3045 + break; 3046 + case 153: 3047 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3048 + { 3049 + #line 377 "LexScan.flex" 3050 + scanErrorException = yytext().Substring(11).Trim(); 3051 + #line default 3052 + } 3053 + break; 3054 + case 92: 3055 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3056 + { 3057 + #line 294 "LexScan.flex" 3058 + inclusive_states = true; yybegin(STATELIST); 3059 + #line default 3060 + } 3061 + break; 3062 + case 104: 3063 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3064 + { 3065 + #line 305 "LexScan.flex" 3066 + lineCount = true; 3067 + #line default 3068 + } 3069 + break; 3070 + case 160: 3071 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3072 + { 3073 + #line 491 "LexScan.flex" 3074 + return symbol(JLETTERDIGITCLASS); 3075 + #line default 3076 + } 3077 + break; 3078 + case 84: 3079 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3080 + { 3081 + #line 547 "LexScan.flex" 3082 + @string.Append('\r'); 3083 + #line default 3084 + } 3085 + break; 3086 + case 48: 3087 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3088 + { 3089 + #line 515 "LexScan.flex" 3090 + if (balance > 0) balance--; else yybegin(REGEXP); return symbol(CLOSECLASS); 3091 + #line default 3092 + } 3093 + break; 3094 + case 36: 3095 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3096 + { 3097 + #line 590 "LexScan.flex" 3098 + if (balance > 0) { 3099 + balance--; 3100 + actionText.Append('}'); 3101 + } 3102 + else { 3103 + yybegin(REGEXPSTART); 3104 + Action a = new Action(actionText.ToString(), action_line); 3105 + actions.Add(a); 3106 + return symbol(ACTION, a); 3107 + } 3108 + 3109 + #line default 3110 + } 3111 + break; 3112 + case 59: 3113 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3114 + { 3115 + #line 610 "LexScan.flex" 3116 + if (commentbalance > 0) 3117 + commentbalance--; 3118 + else 3119 + yybegin(nextState); 3120 + 3121 + #line default 3122 + } 3123 + break; 3124 + case 94: 3125 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3126 + { 3127 + #line 473 "LexScan.flex" 3128 + return symbol_countUpdate(MACROUSE, makeMacroIdent()); 3129 + #line default 3130 + } 3131 + break; 3132 + case 119: 3133 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3134 + { 3135 + #line 442 "LexScan.flex" 3136 + throw new ScannerException(file,ErrorMessages.EOF_WO_ACTION); 3137 + #line default 3138 + } 3139 + break; 3140 + case 38: 3141 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3142 + { 3143 + #line 425 "LexScan.flex" 3144 + return symbol(IDENT, yytext()); 3145 + #line default 3146 + } 3147 + break; 3148 + case 35: 3149 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3150 + { 3151 + #line 602 "LexScan.flex" 3152 + actionText.Append(yytext()); 3153 + #line default 3154 + } 3155 + break; 3156 + case 110: 3157 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3158 + { 3159 + #line 333 "LexScan.flex" 3160 + isYYEOF = true; 3161 + #line default 3162 + } 3163 + break; 3164 + case 112: 3165 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3166 + { 3167 + #line 337 "LexScan.flex" 3168 + return symbol(UNICODE); 3169 + #line default 3170 + } 3171 + break; 3172 + case 109: 3173 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3174 + { 3175 + #line 343 "LexScan.flex" 3176 + isFinal = true; 3177 + #line default 3178 + } 3179 + break; 3180 + case 13: 3181 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3182 + { 3183 + #line 381 "LexScan.flex" 3184 + yybegin(REGEXP); return symbol(EQUALS); 3185 + #line default 3186 + } 3187 + break; 3188 + case 60: 3189 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3190 + { 3191 + #line 609 "LexScan.flex" 3192 + commentbalance++; 3193 + #line default 3194 + } 3195 + break; 3196 + case 151: 3197 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3198 + { 3199 + #line 339 "LexScan.flex" 3200 + isImplementing = concExc(isImplementing, yytext().Substring(12).Trim()); 3201 + #line default 3202 + } 3203 + break; 3204 + case 53: 3205 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3206 + { 3207 + #line 507 "LexScan.flex" 3208 + 3209 + #line default 3210 + } 3211 + break; 3212 + case 3: 3213 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3214 + { 3215 + #line 572 "LexScan.flex" 3216 + epilogue.Append(yytext()); 3217 + #line default 3218 + } 3219 + break; 3220 + case 149: 3221 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3222 + { 3223 + #line 284 "LexScan.flex" 3224 + eofThrow = concExc(eofThrow,@string); yybegin(MACROS); 3225 + #line default 3226 + } 3227 + break; 3228 + case 100: 3229 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3230 + { 3231 + #line 417 "LexScan.flex" 3232 + yybegin(USEREPILOGUE); 3233 + epilogue.Length = 0; 3234 + updateCopyOfLineCount(yytext()); 3235 + epilogue_line = yyline_copy + 1; 3236 + return symbol(DELIMITER); 3237 + #line default 3238 + } 3239 + break; 3240 + case 117: 3241 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3242 + { 3243 + #line 307 "LexScan.flex" 3244 + isInteger = true; 3245 + if (eofVal == null) 3246 + eofVal = "return 0;"; 3247 + eofclose = true; 3248 + 3249 + #line default 3250 + } 3251 + break; 3252 + case 9: 3253 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3254 + { 3255 + #line 380 "LexScan.flex" 3256 + return symbol(IDENT, yytext()); 3257 + #line default 3258 + } 3259 + break; 3260 + case 63: 3261 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3262 + { 3263 + #line 392 "LexScan.flex" 3264 + Out.warning(ErrorMessages.NOT_AT_BOL, yyline); yypushback(1); 3265 + #line default 3266 + } 3267 + break; 3268 + case 32: 3269 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3270 + { 3271 + #line 466 "LexScan.flex" 3272 + return symbol(QUESTION); 3273 + #line default 3274 + } 3275 + break; 3276 + case 134: 3277 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3278 + { 3279 + #line 338 "LexScan.flex" 3280 + caseless = true; 3281 + #line default 3282 + } 3283 + break; 3284 + case 123: 3285 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3286 + { 3287 + #line 376 "LexScan.flex" 3288 + throw new ScannerException(file,ErrorMessages.QUIL_THROW, yyline); 3289 + #line default 3290 + } 3291 + break; 3292 + case 99: 3293 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3294 + { 3295 + #line 312 "LexScan.flex" 3296 + cupCompatible = true; 3297 + isImplementing = concExc(isImplementing, "java_cup.runtime.Scanner"); 3298 + if (functionName == null) 3299 + functionName = "next_token"; 3300 + if (tokenType == null) 3301 + tokenType = "java_cup.runtime.Symbol"; 3302 + if (eofVal == null) 3303 + eofVal = "return new java_cup.runtime.Symbol("+cupSymbol+".EOF);"; 3304 + if (!Options.jlex) eofclose = true; 3305 + 3306 + #line default 3307 + } 3308 + break; 3309 + case 131: 3310 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3311 + { 3312 + #line 344 "LexScan.flex" 3313 + isAbstract = true; 3314 + #line default 3315 + } 3316 + break; 3317 + case 158: 3318 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3319 + { 3320 + #line 285 "LexScan.flex" 3321 + lexThrow = concExc(lexThrow,@string); yybegin(MACROS); 3322 + #line default 3323 + } 3324 + break; 3325 + case 157: 3326 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3327 + { 3328 + #line 495 "LexScan.flex" 3329 + return symbol(LOWERCLASS); 3330 + #line default 3331 + } 3332 + break; 3333 + case 71: 3334 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3335 + { 3336 + #line 564 "LexScan.flex" 3337 + return symbol(CHAR, '\r'); 3338 + #line default 3339 + } 3340 + break; 3341 + case 8: 3342 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3343 + { 3344 + #line 299 "LexScan.flex" 3345 + yybegin(MACROS); 3346 + #line default 3347 + } 3348 + break; 3349 + case 17: 3350 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3351 + { 3352 + #line 498 "LexScan.flex" 3353 + return symbol(CHAR, yytext()[0]); 3354 + #line default 3355 + } 3356 + break; 3357 + case 114: 3358 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3359 + { 3360 + #line 330 "LexScan.flex" 3361 + tokenType = yytext().Substring(6).Trim(); 3362 + #line default 3363 + } 3364 + break; 3365 + case 133: 3366 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3367 + { 3368 + #line 325 "LexScan.flex" 3369 + cupDebug = true; 3370 + #line default 3371 + } 3372 + break; 3373 + case 34: 3374 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3375 + { 3376 + #line 468 "LexScan.flex" 3377 + bolUsed = true; return symbol(HAT); 3378 + #line default 3379 + } 3380 + break; 3381 + case 21: 3382 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3383 + { 3384 + #line 470 "LexScan.flex" 3385 + yybegin(CHARCLASS); return symbol(OPENCLASS); 3386 + #line default 3387 + } 3388 + break; 3389 + case 65: 3390 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3391 + { 3392 + #line 406 "LexScan.flex" 3393 + nextState = REGEXPSTART; yybegin(COMMENT); 3394 + #line default 3395 + } 3396 + break; 3397 + case 6: 3398 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3399 + { 3400 + #line 297 "LexScan.flex" 3401 + states.insert(yytext(),inclusive_states); 3402 + #line default 3403 + } 3404 + break; 3405 + case 43: 3406 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3407 + { 3408 + #line 537 "LexScan.flex" 3409 + throw new ScannerException(file,ErrorMessages.UNTERMINATED_STR, yyline, yycolumn); 3410 + #line default 3411 + } 3412 + break; 3413 + case 7: 3414 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3415 + { 3416 + #line 298 "LexScan.flex" 3417 + 3418 + #line default 3419 + } 3420 + break; 3421 + case 95: 3422 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3423 + { 3424 + #line 540 "LexScan.flex" 3425 + @string.Append( (char) Integer.parseInt(yytext().Substring(2,yytext().Length-2), 16)); 3426 + #line default 3427 + } 3428 + break; 3429 + case 23: 3430 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3431 + { 3432 + #line 471 "LexScan.flex" 3433 + lookAheadUsed = true; return symbol(LOOKAHEAD); 3434 + #line default 3435 + } 3436 + break; 3437 + case 107: 3438 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3439 + { 3440 + #line 335 "LexScan.flex" 3441 + 3442 + #line default 3443 + } 3444 + break; 3445 + case 118: 3446 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3447 + { 3448 + #line 341 "LexScan.flex" 3449 + isPublic = true; 3450 + #line default 3451 + } 3452 + break; 3453 + case 77: 3454 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3455 + { 3456 + #line 474 "LexScan.flex" 3457 + yybegin(REPEATEXP); return symbol(REPEAT, int.Parse(yytext().Trim().Substring(1).Trim())); 3458 + #line default 3459 + } 3460 + break; 3461 + case 47: 3462 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3463 + { 3464 + #line 514 "LexScan.flex" 3465 + balance++; return symbol(OPENCLASS); 3466 + #line default 3467 + } 3468 + break; 3469 + case 78: 3470 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3471 + { 3472 + #line 444 "LexScan.flex" 3473 + if (macroDefinition) { 3474 + yybegin(EATWSPNL); 3475 + return symbol(BAR); 3476 + } 3477 + else { 3478 + yybegin(REGEXPSTART); 3479 + return symbol(NOACTION); 3480 + } 3481 + 3482 + #line default 3483 + } 3484 + break; 3485 + case 5: 3486 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3487 + { 3488 + #line 621 "LexScan.flex" 3489 + throw new ScannerException(file,ErrorMessages.UNEXPECTED_CHAR, yyline, yycolumn); 3490 + #line default 3491 + } 3492 + break; 3493 + case 141: 3494 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3495 + { 3496 + #line 492 "LexScan.flex" 3497 + return symbol(LETTERCLASS); 3498 + #line default 3499 + } 3500 + break; 3501 + case 12: 3502 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3503 + { 3504 + #line 391 "LexScan.flex" 3505 + throw new ScannerException(file,ErrorMessages.UNKNOWN_OPTION, yyline, yycolumn); 3506 + #line default 3507 + } 3508 + break; 3509 + case 31: 3510 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3511 + { 3512 + #line 465 "LexScan.flex" 3513 + return symbol(PLUS); 3514 + #line default 3515 + } 3516 + break; 3517 + case 28: 3518 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3519 + { 3520 + #line 461 "LexScan.flex" 3521 + return symbol(TILDE); 3522 + #line default 3523 + } 3524 + break; 3525 + default: 3526 + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { 3527 + zzAtEOF = true; 3528 + zzDoEOF(); 3529 + switch (zzLexicalState) { 3530 + case JAVA_CODE: 3531 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3532 + { 3533 + #line 604 "LexScan.flex" 3534 + throw new ScannerException(file,ErrorMessages.EOF_IN_ACTION, action_line-1); 3535 + #line default 3536 + } 3537 + break; 3538 + case STATES: 3539 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3540 + { 3541 + #line 432 "LexScan.flex" 3542 + throw new ScannerException(file,ErrorMessages.EOF_IN_STATES); 3543 + #line default 3544 + } 3545 + break; 3546 + case USEREPILOGUE: 3547 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3548 + { 3549 + #line 573 "LexScan.flex" 3550 + if ( yymoreStreams() ) 3551 + { 3552 + file = (File) files.Pop(); 3553 + yypopStream(); 3554 + } 3555 + else if (epilogue_sent) 3556 + return symbol(EOF); 3557 + else 3558 + { 3559 + epilogue_sent = true; 3560 + return symbol(EPILOGUE, epilogue); 3561 + } 3562 + 3563 + #line default 3564 + } 3565 + break; 3566 + case MACROS: 3567 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3568 + { 3569 + #line 396 "LexScan.flex" 3570 + if ( yymoreStreams() ) { 3571 + file = (File) files.Pop(); 3572 + yypopStream(); 3573 + } 3574 + else 3575 + throw new ScannerException(file,ErrorMessages.EOF_IN_MACROS); 3576 + 3577 + #line default 3578 + } 3579 + break; 3580 + case STATELIST: 3581 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3582 + { 3583 + #line 300 "LexScan.flex" 3584 + throw new ScannerException(file,ErrorMessages.EOF_IN_MACROS); 3585 + #line default 3586 + } 3587 + break; 3588 + case REPEATEXP: 3589 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3590 + { 3591 + #line 509 "LexScan.flex" 3592 + throw new ScannerException(file,ErrorMessages.EOF_IN_REGEXP); 3593 + #line default 3594 + } 3595 + break; 3596 + case COPY: 3597 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3598 + { 3599 + #line 290 "LexScan.flex" 3600 + throw new ScannerException(file,ErrorMessages.EOF_IN_MACROS); 3601 + #line default 3602 + } 3603 + break; 3604 + case COMMENT: 3605 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3606 + { 3607 + #line 618 "LexScan.flex" 3608 + throw new ScannerException(file,ErrorMessages.EOF_IN_COMMENT); 3609 + #line default 3610 + } 3611 + break; 3612 + case CHARCLASS: 3613 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3614 + { 3615 + #line 529 "LexScan.flex" 3616 + throw new ScannerException(file,ErrorMessages.EOF_IN_REGEXP); 3617 + #line default 3618 + } 3619 + break; 3620 + case STRING_CONTENT: 3621 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3622 + { 3623 + #line 551 "LexScan.flex" 3624 + throw new ScannerException(file,ErrorMessages.EOF_IN_STRING); 3625 + #line default 3626 + } 3627 + break; 3628 + default: 3629 + if (ZZ_SPURIOUS_WARNINGS_SUCK) 3630 + { 3631 + #line 624 "LexScan.flex" 3632 + if ( yymoreStreams() ) { 3633 + file = (File) files.Pop(); 3634 + yypopStream(); 3635 + } 3636 + else 3637 + return symbol(EOF); 3638 + #line default 3639 + } 3640 + break; 3641 + } 3642 + } 3643 + else { 3644 + zzScanError(ZZ_NO_MATCH); 3645 + } 3646 + break; 3647 + } 3648 + } 3649 + } 3650 + 3651 + /** 3652 + * Converts an int token code into the name of the 3653 + * token by reflection on the cup symbol class/interface sym 3654 + * 3655 + * This code was contributed by Karl Meissner <meissnersd@yahoo.com> 3656 + */ 3657 + private String getTokenName(int token) { 3658 + try { 3659 + System.Reflection.FieldInfo[] classFields = typeof(sym).GetFields(); 3660 + for (int i = 0; i < classFields.Length; i++) { 3661 + if (((int)classFields[i].GetValue(null)) == token) { 3662 + return classFields[i].Name; 3663 + } 3664 + } 3665 + } catch (Exception e) { 3666 + Out.error(e.ToString()); 3667 + } 3668 + 3669 + return "UNKNOWN TOKEN"; 3670 + } 3671 + 3672 + /** 3673 + * Same as next_token but also prints the token to standard out 3674 + * for debugging. 3675 + * 3676 + * This code was contributed by Karl Meissner <meissnersd@yahoo.com> 3677 + */ 3678 + public Symbol debug_next_token() { 3679 + java_cup.runtime.Symbol s = next_token(); 3680 + Console.WriteLine( "line:{0} col:{1} --{2}--{3}--", 3681 + 3682 + yyline+1, yycolumn+1, yytext(), getTokenName(s.sym)); 3683 + return s; 3684 + } 3685 + 3686 + /** 3687 + * Runs the scanner on input files. 3688 + * 3689 + * This main method is the debugging routine for the scanner. 3690 + * It prints debugging information about each returned token to 3691 + * System.out until the end of file is reached, or an error occured. 3692 + * 3693 + * @param argv the command line, contains the filenames to run 3694 + * the scanner on. 3695 + */ 3696 + public static void Main(String[] argv) { 3697 + if (argv.Length == 0) { 3698 + Console.WriteLine("Usage : LexScan <inputfile>"); 3699 + } 3700 + else { 3701 + for (int i = 0; i < argv.Length; i++) { 3702 + LexScan scanner = null; 3703 + try { 3704 + scanner = new LexScan( new StreamReader(argv[i]) ); 3705 + while ( !scanner.zzAtEOF ) scanner.debug_next_token(); 3706 + } 3707 + catch (FileNotFoundException) { 3708 + Console.WriteLine("File not found : \"{0}\"", argv[i]); 3709 + } 3710 + catch (IOException e) { 3711 + Console.WriteLine("IO error scanning file \"{0}\"", argv[i]); 3712 + Console.WriteLine(e); 3713 + } 3714 + catch (Exception e) { 3715 + Console.WriteLine("Unexpected exception:"); 3716 + Console.WriteLine(e.ToString()); 3717 + } 3718 + } 3719 + } 3720 + } 3721 + 3722 + 3723 + } 3724 + #line 632 "LexScan.flex" 3725 + 3726 + } // end of 'namespace' 3727 + 3728 + #line default
+112
CSFlex/Core/LexicalStates.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + using System.Collections; 27 + using System.Linq; 28 + 29 + // Modified in July 2026 by the Prexonite contributors to make emitted source 30 + // deterministic across processes. See COPYRIGHT for GNU GPL version 2 terms. 31 + 32 + namespace CSFlex 33 + { 34 + 35 + /** 36 + * Simple symbol table, mapping lexical state names to integers. 37 + * 38 + * @author Gerwin Klein 39 + * @version JFlex 1.4, $Revision: 2.1 $, $Date: 2004/04/12 10:07:48 $ 40 + * @author Jonathan Gilbert 41 + * @version CSFlex 1.4 42 + */ 43 + public class LexicalStates { 44 + 45 + /** maps state name to state number */ 46 + Hashtable states; 47 + 48 + /** codes of inclusive states (subset of states) */ 49 + ArrayList inclusive; 50 + 51 + /** number of declared states */ 52 + int numStates; 53 + 54 + 55 + /** 56 + * constructs a new lexical state symbol table 57 + */ 58 + public LexicalStates() { 59 + states = new PrettyHashtable(); 60 + inclusive = new PrettyArrayList(); 61 + } 62 + 63 + 64 + /** 65 + * insert a new state declaration 66 + */ 67 + public void insert(String name, bool is_inclusive) { 68 + if ( states.ContainsKey(name) ) return; 69 + 70 + Integer code = new Integer(numStates++); 71 + states[name] = code; 72 + 73 + if (is_inclusive) 74 + inclusive.Add(code.intValue()); 75 + } 76 + 77 + 78 + /** 79 + * returns the number (code) of a declared state, 80 + * <code>null</code> if no such state has been declared. 81 + */ 82 + public Integer getNumber(String name) { 83 + return (Integer)states[name]; 84 + } 85 + 86 + 87 + /** 88 + * returns the number of declared states 89 + */ 90 + public int number() { 91 + return numStates; 92 + } 93 + 94 + 95 + /** 96 + * returns the names of all states 97 + */ 98 + public IEnumerator names() { 99 + return states.Keys 100 + .Cast<String>() 101 + .OrderBy(name => ((Integer)states[name]).intValue()) 102 + .GetEnumerator(); 103 + } 104 + 105 + /** 106 + * returns the code of all inclusive states 107 + */ 108 + public IEnumerator getInclusiveStates() { 109 + return inclusive.GetEnumerator(); 110 + } 111 + } 112 + }
+58
CSFlex/Core/MacroException.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + 27 + namespace CSFlex 28 + { 29 + 30 + 31 + /** 32 + * This Exception is used in the macro expander to report cycles or 33 + * undefined macro usages. 34 + * 35 + * @author Gerwin Klein 36 + * @version JFlex 1.4, $Revision: 2.1 $, $Date: 2004/04/12 10:07:48 $ 37 + * @author Jonathan Gilbert 38 + * @version CSFlex 1.4 39 + */ 40 + public class MacroException: RuntimeException { 41 + 42 + /** 43 + * Creates a new MacroException without message 44 + */ 45 + public MacroException() { 46 + } 47 + 48 + 49 + /** 50 + * Creates a new MacroException with the specified message 51 + * 52 + * @param message the error description presented to the user. 53 + */ 54 + public MacroException(String message) : base(message) { 55 + } 56 + 57 + } 58 + }
+284
CSFlex/Core/Macros.cs
··· 1 + // #define DEBUG_TRACE 2 + 3 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 4 + * C# Flex 1.4 * 5 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 6 + * Derived from: * 7 + * * 8 + * JFlex 1.4 * 9 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 10 + * All rights reserved. * 11 + * * 12 + * This program is free software; you can redistribute it and/or modify * 13 + * it under the terms of the GNU General Public License. See the file * 14 + * COPYRIGHT for more information. * 15 + * * 16 + * This program is distributed in the hope that it will be useful, * 17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 19 + * GNU General Public License for more details. * 20 + * * 21 + * You should have received a copy of the GNU General Public License along * 22 + * with this program; if not, write to the Free Software Foundation, Inc., * 23 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 24 + * * 25 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 26 + 27 + using System; 28 + using System.Collections; 29 + 30 + namespace CSFlex 31 + { 32 + 33 + /** 34 + * Symbol table and expander for macros. 35 + * 36 + * Maps macros to their (expanded) definitions, detects cycles and 37 + * unused macros. 38 + * 39 + * @author Gerwin Klein 40 + * @version JFlex 1.4, $Revision: 2.3 $, $Date: 2004/04/12 10:07:47 $ 41 + * @author Jonathan Gilbert 42 + * @version CSFlex 1.4 43 + */ 44 + public sealed class Macros { 45 + 46 + /** Maps names of macros to their definition */ 47 + private Hashtable macros; 48 + 49 + /** Maps names of macros to their "used" flag */ 50 + private Hashtable used; 51 + 52 + #if DEBUG_TRACE 53 + System.IO.StreamWriter log = new System.IO.StreamWriter(@"x:\macros_csharp.log"); 54 + #endif // DEBUG_TRACE 55 + 56 + /** 57 + * Creates a new macro expander. 58 + */ 59 + public Macros() { 60 + #if DEBUG_TRACE 61 + log.AutoFlush = true; 62 + log.WriteLine("Macros()"); 63 + #endif // DEBUG_TRACE 64 + 65 + macros = new PrettyHashtable(); 66 + used = new PrettyHashtable(); 67 + } 68 + 69 + 70 + /** 71 + * Stores a new macro and its definition. 72 + * 73 + * @param name the name of the new macro 74 + * @param definition the definition of the new macro 75 + * 76 + * @return <code>true</code>, iff the macro name has not been 77 + * stored before. 78 + */ 79 + public bool insert(String name, RegExp definition) { 80 + #if DEBUG_TRACE 81 + log.WriteLine("insert(String name = \"{0}\", RegExp definition = {1})", name, definition); 82 + #endif // DEBUG_TRACE 83 + 84 + if (Options.DEBUG) 85 + Out.debug("inserting macro "+name+" with definition :"+Out.NL+definition); //$NON-NLS-1$ //$NON-NLS-2$ 86 + 87 + used[name] = false; 88 + 89 + bool new_entry = !macros.ContainsKey(name); 90 + macros[name] = definition; 91 + return new_entry; 92 + } 93 + 94 + 95 + /** 96 + * Marks a makro as used. 97 + * 98 + * @return <code>true</code>, iff the macro name has been 99 + * stored before. 100 + */ 101 + public bool markUsed(String name) { 102 + #if DEBUG_TRACE 103 + log.WriteLine("markUsed(String name = \"{0}\")", name); 104 + #endif // DEBUG_TRACE 105 + 106 + bool already_stored = used.ContainsKey(name); 107 + used[name] = true; 108 + return already_stored; 109 + } 110 + 111 + 112 + /** 113 + * Tests if a macro has been used. 114 + * 115 + * @return <code>true</code>, iff the macro has been used in 116 + * a regular expression. 117 + */ 118 + public bool isUsed(String name) { 119 + #if DEBUG_TRACE 120 + log.WriteLine("isUsed(String name = \"{0}\")", name); 121 + #endif // DEBUG_TRACE 122 + 123 + return (bool)used[name]; 124 + } 125 + 126 + 127 + /** 128 + * Returns all unused macros. 129 + * 130 + * @return the enumeration of macro names that have not been used. 131 + */ 132 + public IEnumerator unused() { 133 + #if DEBUG_TRACE 134 + log.WriteLine("unused()"); 135 + #endif // DEBUG_TRACE 136 + 137 + ArrayList unUsed = new PrettyArrayList(); 138 + 139 + IEnumerator names = used.Keys.GetEnumerator(); 140 + while ( names.MoveNext() ) { 141 + String name = (String) names.Current; 142 + bool isUsed = (bool)used[name]; 143 + if ( !isUsed ) 144 + unUsed.Add(name); 145 + } 146 + 147 + return unUsed.GetEnumerator(); 148 + } 149 + 150 + 151 + /** 152 + * Fetches the definition of the macro with the specified name, 153 + * <p> 154 + * The definition will either be the same as stored (expand() not 155 + * called), or an equivalent one, that doesn't contain any macro 156 + * usages (expand() called before). 157 + * 158 + * @param name the name of the macro 159 + * 160 + * @return the definition of the macro, <code>null</code> if 161 + * no macro with the specified name has been stored. 162 + * 163 + * @see CSFlex.Macros#expand 164 + */ 165 + public RegExp getDefinition(String name) { 166 + #if DEBUG_TRACE 167 + log.WriteLine("getDefinition(String name = \"{0}\")", name); 168 + #endif // DEBUG_TRACE 169 + 170 + return (RegExp) macros[name]; 171 + } 172 + 173 + 174 + /** 175 + * Expands all stored macros, so that getDefinition always returns 176 + * a defintion that doesn't contain any macro usages. 177 + * 178 + * @throws MacroException if there is a cycle in the macro usage graph. 179 + */ 180 + public void expand() { 181 + #if DEBUG_TRACE 182 + log.WriteLine("expand()"); 183 + #endif // DEBUG_TRACE 184 + 185 + IEnumerator names; 186 + 187 + // FIXME: ugly hack for C# since the 'macros[name]' assignment below 188 + // counts as a change to the collection 189 + // for debugging: sort the list 190 + ArrayList keys = new ArrayList(macros.Keys); 191 + #if DEBUG_TRACE 192 + keys.Sort(); 193 + #endif // DEBUG_TRACE 194 + names = keys.GetEnumerator(); 195 + 196 + while ( names.MoveNext() ) { 197 + 198 + #if DEBUG_TRACE 199 + log.Write("used map: "); 200 + foreach (string _name in keys) 201 + if (isUsed(_name)) 202 + log.Write("1"); 203 + else 204 + log.Write("0"); 205 + log.WriteLine(""); 206 + #endif // DEBUG_TRACE 207 + 208 + String name = (String) names.Current; 209 + if ( isUsed(name) ) 210 + macros[name] = expandMacro(name, getDefinition(name)); 211 + // this put doesn't get a new key, so only a new value 212 + // is set for the key "name" (without changing the enumeration 213 + // "names"!) 214 + } 215 + } 216 + 217 + 218 + /** 219 + * Expands the specified macro by replacing each macro usage 220 + * with the stored definition. 221 + * 222 + * @param name the name of the macro to expand (for detecting cycles) 223 + * @param definition the definition of the macro to expand 224 + * 225 + * @return the expanded definition of the macro. 226 + * 227 + * @throws MacroException when an error (such as a cyclic definition) 228 + * occurs during expansion 229 + */ 230 + private RegExp expandMacro(String name, RegExp definition) { 231 + #if DEBUG_TRACE 232 + log.WriteLine("expandMacro(String name = \"{0}\", RegExp definition = {1})", name, definition); 233 + #endif // DEBUG_TRACE 234 + 235 + // Out.print("checking macro "+name); 236 + // Out.print("definition is "+definition); 237 + 238 + switch ( definition.type ) 239 + { 240 + case sym.BAR: 241 + case sym.CONCAT: 242 + RegExp2 binary = (RegExp2) definition; 243 + binary.r1 = expandMacro(name, binary.r1); 244 + binary.r2 = expandMacro(name, binary.r2); 245 + return definition; 246 + 247 + case sym.STAR: 248 + case sym.PLUS: 249 + case sym.QUESTION: 250 + case sym.BANG: 251 + case sym.TILDE: 252 + RegExp1 unary = (RegExp1) definition; 253 + unary.content = expandMacro(name, (RegExp) unary.content); 254 + return definition; 255 + 256 + case sym.MACROUSE: 257 + String usename = (String) ((RegExp1) definition).content; 258 + 259 + if ( name.Equals(usename) ) 260 + throw new MacroException(ErrorMessages.get(ErrorMessages.MACRO_CYCLE, name)); 261 + 262 + RegExp usedef = getDefinition(usename); 263 + 264 + if ( usedef == null ) 265 + throw new MacroException(ErrorMessages.get(ErrorMessages.MACRO_DEF_MISSING, usename, name)); 266 + 267 + markUsed(usename); 268 + 269 + return expandMacro(name, usedef); 270 + 271 + case sym.STRING: 272 + case sym.STRING_I: 273 + case sym.CHAR: 274 + case sym.CHAR_I: 275 + case sym.CCLASS: 276 + case sym.CCLASSNOT: 277 + return definition; 278 + 279 + default: 280 + throw new MacroException("unknown expression type "+definition.type+" in macro expansion"); //$NON-NLS-1$ //$NON-NLS-2$ 281 + } 282 + } 283 + } 284 + }
+1007
CSFlex/Core/NFA.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + using System.Collections; 27 + using System.IO; 28 + using System.Text; 29 + 30 + namespace CSFlex 31 + { 32 + 33 + /** 34 + * NFA representation in CSFlex. 35 + * 36 + * Contains algorithms RegExp -> NFA and NFA -> DFA. 37 + * 38 + * @author Gerwin Klein 39 + * @version JFlex 1.4, $Revision: 2.7 $, $Date: 2004/04/12 10:07:47 $ 40 + * @author Jonathan Gilbert 41 + * @version CSFlex 1.4 42 + */ 43 + sealed public class NFA { 44 + 45 + // table[current_state][next_char] is the set of states that can be reached 46 + // from current_state with an input next_char 47 + internal StateSet [][] table; 48 + 49 + // epsilon[current_state] is the set of states that can be reached 50 + // from current_state via epsilon-edges 51 + internal StateSet [] epsilon; 52 + 53 + // isFinal[state] == true <=> state is a final state of the NFA 54 + internal bool [] isFinal; 55 + 56 + // isPushback[state] == true <=> state is the final state of a regexp that 57 + // should only be matched when followed by a certain lookahead. 58 + internal bool [] isPushback; 59 + 60 + // action[current_state]: the action associated with the state 61 + // current_state (null, if there is no action for the state) 62 + internal Action [] action; 63 + 64 + // the number of states in this NFA 65 + internal int numStates; 66 + 67 + // the current maximum number of input characters 68 + internal int numInput; 69 + 70 + // the number of lexical States. Lexical states have the indices 71 + // 0..numLexStates-1 in the transition table 72 + internal int numLexStates; 73 + 74 + // estimated size of the NFA (before actual construction) 75 + internal int estSize = 256; 76 + 77 + internal Macros macros; 78 + internal CharClasses classes; 79 + 80 + internal LexScan scanner; 81 + internal RegExps regExps; 82 + 83 + // will be reused by several methods (avoids excessive object creation) 84 + private static StateSetEnumerator states = new StateSetEnumerator(); 85 + private static StateSet tempStateSet = new StateSet(); 86 + 87 + public NFA(int numInput, int estSize) { 88 + this.numInput = numInput; 89 + this.estSize = estSize; 90 + numStates = 0; 91 + epsilon = new StateSet [estSize]; 92 + action = new Action [estSize]; 93 + isFinal = new bool [estSize]; 94 + isPushback = new bool [estSize]; 95 + table = new StateSet[estSize][]; 96 + for (int i=0; i < table.Length; i++) 97 + table[i] = new StateSet[numInput]; 98 + } 99 + 100 + public NFA(int numInput, LexScan scanner, RegExps regExps, 101 + Macros macros, CharClasses classes) 102 + : this(numInput, regExps.NFASize(macros)+2*scanner.states.number()) 103 + { 104 + this.scanner = scanner; 105 + this.regExps = regExps; 106 + this.macros = macros; 107 + this.classes = classes; 108 + 109 + numLexStates = scanner.states.number(); 110 + 111 + ensureCapacity(2*numLexStates); 112 + 113 + numStates = 2*numLexStates; 114 + } 115 + 116 + public void addStandaloneRule() { 117 + // standalone rule has least priority, fires 118 + // transition on all characters and has "print it rule" 119 + int start = numStates; 120 + int end = numStates+1; 121 + 122 + for (int c = 0; c < classes.getNumClasses(); c++) 123 + addTransition(start, c, end); 124 + 125 + for (int i = 0; i < numLexStates*2; i++) 126 + addEpsilonTransition(i, start); 127 + 128 + action[end] = new Action("System.out.print(yytext());", int.MaxValue); 129 + isFinal[end] = true; 130 + } 131 + 132 + 133 + public void addRegExp(int regExpNum) { 134 + 135 + if (Options.DEBUG) 136 + Out.debug("Adding nfa for regexp "+regExpNum+" :"+Out.NL+regExps.getRegExp(regExpNum)); 137 + 138 + IntPair nfa = insertNFA( regExps.getRegExp(regExpNum) ); 139 + 140 + IEnumerator lexStates = regExps.getStates(regExpNum).GetEnumerator(); 141 + 142 + if ( !lexStates.MoveNext() ) 143 + lexStates = scanner.states.getInclusiveStates(); 144 + 145 + lexStates.Reset(); 146 + 147 + while ( lexStates.MoveNext() ) { 148 + int stateNum = (int)lexStates.Current; 149 + 150 + if ( !regExps.isBOL(regExpNum) ) 151 + addEpsilonTransition(2*stateNum, nfa.start); 152 + 153 + addEpsilonTransition(2*stateNum+1, nfa.start); 154 + } 155 + 156 + 157 + if ( regExps.getLookAhead(regExpNum) != null ) { 158 + IntPair look = insertNFA( regExps.getLookAhead(regExpNum) ); 159 + 160 + addEpsilonTransition(nfa.end, look.start); 161 + 162 + Action a = regExps.getAction(regExpNum); 163 + a.setLookAction(true); 164 + 165 + isPushback[nfa.end] = true; 166 + action[look.end] = a; 167 + isFinal[look.end] = true; 168 + } 169 + else { 170 + action[nfa.end] = regExps.getAction(regExpNum); 171 + isFinal[nfa.end] = true; 172 + } 173 + } 174 + 175 + 176 + private void ensureCapacity(int newNumStates) { 177 + int oldLength = epsilon.Length; 178 + 179 + if ( newNumStates < oldLength ) return; 180 + 181 + int newStatesLength = Math.Max(oldLength*2, newNumStates); 182 + 183 + bool [] newFinal = new bool [newStatesLength]; 184 + bool [] newIsPush = new bool [newStatesLength]; 185 + Action [] newAction = new Action [newStatesLength]; 186 + StateSet [] [] newTable = new StateSet [newStatesLength] []; 187 + for (int i=0; i < newTable.Length; i++) 188 + newTable[i] = new StateSet[numInput]; 189 + StateSet [] newEpsilon = new StateSet [newStatesLength]; 190 + 191 + Array.Copy(isFinal,0,newFinal,0,numStates); 192 + Array.Copy(isPushback,0,newIsPush,0,numStates); 193 + Array.Copy(action,0,newAction,0,numStates); 194 + Array.Copy(epsilon,0,newEpsilon,0,numStates); 195 + Array.Copy(table,0,newTable,0,numStates); 196 + 197 + isFinal = newFinal; 198 + isPushback = newIsPush; 199 + action = newAction; 200 + epsilon = newEpsilon; 201 + table = newTable; 202 + } 203 + 204 + public void addTransition(int start, int input, int dest) { 205 + Out.debug("Adding transition ("+start+", "+input+", "+dest+")"); 206 + 207 + int maxS = Math.Max(start,dest)+1; 208 + 209 + ensureCapacity( maxS ); 210 + 211 + if (maxS > numStates) numStates = maxS; 212 + 213 + if ( table[start][input] != null ) 214 + table[start][input].addState(dest); 215 + else 216 + table[start][input] = new StateSet(estSize,dest); 217 + } 218 + 219 + public void addEpsilonTransition(int start, int dest) { 220 + int max = Math.Max(start,dest)+1; 221 + ensureCapacity( max ); 222 + if (max > numStates) numStates = max; 223 + 224 + if (epsilon[start] != null) 225 + epsilon[start].addState(dest); 226 + else 227 + epsilon[start] = new StateSet(estSize,dest); 228 + } 229 + 230 + 231 + /** 232 + * Returns <code>true</code>, iff the specified set of states 233 + * contains a final state. 234 + * 235 + * @param set the set of states that is tested for final states. 236 + */ 237 + private bool containsFinal(StateSet set) { 238 + states.reset(set); 239 + 240 + while ( states.hasMoreElements() ) 241 + if ( isFinal[states.nextElement()] ) return true; 242 + 243 + return false; 244 + } 245 + 246 + 247 + /** 248 + * Returns <code>true</code>, iff the specified set of states 249 + * contains a pushback-state. 250 + * 251 + * @param set the set of states that is tested for pushback-states. 252 + */ 253 + private bool containsPushback(StateSet set) { 254 + states.reset(set); 255 + 256 + while ( states.hasMoreElements() ) 257 + if ( isPushback[states.nextElement()] ) return true; 258 + 259 + return false; 260 + } 261 + 262 + 263 + /** 264 + * Returns the action with highest priority in the specified 265 + * set of states. 266 + * 267 + * @param set the set of states for which to determine the action 268 + */ 269 + private Action getAction(StateSet set) { 270 + 271 + states.reset(set); 272 + 273 + Action maxAction = null; 274 + 275 + Out.debug("Determining action of : "+set); 276 + 277 + while ( states.hasMoreElements() ) { 278 + 279 + Action currentAction = action[ states.nextElement() ]; 280 + 281 + if ( currentAction != null ) { 282 + if (maxAction == null) 283 + maxAction = currentAction; 284 + else 285 + maxAction = maxAction.getHigherPriority(currentAction); 286 + } 287 + 288 + } 289 + 290 + return maxAction; 291 + } 292 + 293 + 294 + /** 295 + * Calculates the epsilon closure for a specified set of states. 296 + * 297 + * The epsilon closure for set a is the set of states that can be reached 298 + * by epsilon edges from a. 299 + * 300 + * @param set the set of states to calculate the epsilon closure for 301 + * 302 + * @return the epsilon closure of the specified set of states 303 + * in this NFA 304 + */ 305 + private StateSet closure(int startState) { 306 + 307 + // Out.debug("Calculating closure of "+set); 308 + 309 + StateSet notvisited = tempStateSet; 310 + StateSet closure = new StateSet(numStates,startState); 311 + 312 + notvisited.clear(); 313 + notvisited.addState(startState); 314 + 315 + while ( notvisited.containsElements() ) { 316 + // Out.debug("closure is now "+closure); 317 + // Out.debug("notvisited is "+notvisited); 318 + int state = notvisited.getAndRemoveElement(); 319 + // Out.debug("removed element "+state+" of "+notvisited); 320 + // Out.debug("epsilon[states] = "+epsilon[state]); 321 + notvisited.add(closure.complement(epsilon[state])); 322 + closure.add(epsilon[state]); 323 + } 324 + 325 + // Out.debug("Closure is : "+closure); 326 + 327 + return closure; 328 + } 329 + 330 + /** 331 + * Returns the epsilon closure of a set of states 332 + */ 333 + private StateSet closure(StateSet startStates) { 334 + StateSet result = new StateSet(numStates); 335 + 336 + if (startStates != null) { 337 + states.reset(startStates); 338 + while (states.hasMoreElements()) 339 + result.add( closure(states.nextElement()) ); 340 + } 341 + 342 + return result; 343 + } 344 + 345 + 346 + private void epsilonFill() { 347 + for (int i = 0; i < numStates; i++) { 348 + epsilon[i] = closure(i); 349 + } 350 + } 351 + 352 + /** 353 + * Calculates the set of states that can be reached from another 354 + * set of states <code>start</code> with an specified input 355 + * character <code>input</code> 356 + * 357 + * @param start the set of states to start from 358 + * @param input the input character for which to search the next states 359 + * 360 + * @return the set of states that are reached from <code>start</code> 361 + * via <code>input</code> 362 + */ 363 + private StateSet DFAEdge(StateSet start, char input) { 364 + // Out.debug("Calculating DFAEdge for state set "+start+" and input '"+input+"'"); 365 + 366 + tempStateSet.clear(); 367 + 368 + states.reset(start); 369 + while ( states.hasMoreElements() ) 370 + tempStateSet.add( table[states.nextElement()][input] ); 371 + 372 + StateSet result = new StateSet(tempStateSet); 373 + 374 + states.reset(tempStateSet); 375 + while ( states.hasMoreElements() ) 376 + result.add( epsilon[states.nextElement()] ); 377 + 378 + // Out.debug("DFAEdge is : "+result); 379 + 380 + return result; 381 + } 382 + 383 + 384 + /** 385 + * Returns an DFA that accepts the same language as this NFA. 386 + * This DFA is usualy not minimal. 387 + */ 388 + public DFA getDFA() { 389 + 390 + Hashtable dfaStates = new PrettyHashtable(numStates); 391 + ArrayList dfaVector = new PrettyArrayList(numStates); 392 + 393 + DFA dfa = new DFA(2*numLexStates, numInput); 394 + 395 + int numDFAStates = 0; 396 + int currentDFAState = 0; 397 + 398 + Out.println("Converting NFA to DFA : "); 399 + 400 + epsilonFill(); 401 + 402 + StateSet currentState, newState; 403 + 404 + for ( int i = 0; i < 2*numLexStates; i++ ) { 405 + newState = epsilon[i]; 406 + 407 + dfaStates[newState] = new Integer(numDFAStates); 408 + dfaVector.Add(newState); 409 + 410 + dfa.setLexState( i, numDFAStates ); 411 + 412 + dfa.setFinal( numDFAStates, containsFinal(newState) ); 413 + dfa.setPushback( numDFAStates, containsPushback(newState) ); 414 + dfa.setAction( numDFAStates, getAction(newState) ); 415 + 416 + numDFAStates++; 417 + } 418 + 419 + numDFAStates--; 420 + 421 + if (Options.DEBUG) 422 + Out.debug("DFA start states are :"+Out.NL+dfaStates+Out.NL+Out.NL+"ordered :"+Out.NL+dfaVector); 423 + 424 + currentDFAState = 0; 425 + 426 + StateSet tempStateSet = NFA.tempStateSet; 427 + StateSetEnumerator states = NFA.states; 428 + 429 + // will be reused 430 + newState = new StateSet(numStates); 431 + 432 + while ( currentDFAState <= numDFAStates ) { 433 + 434 + currentState = (StateSet) dfaVector[currentDFAState]; 435 + 436 + for (char input = (char)0; input < numInput; input++) { 437 + 438 + // newState = DFAEdge(currentState, input); 439 + 440 + // inlining DFAEdge for performance: 441 + 442 + // Out.debug("Calculating DFAEdge for state set "+currentState+" and input '"+input+"'"); 443 + 444 + tempStateSet.clear(); 445 + states.reset(currentState); 446 + while ( states.hasMoreElements() ) 447 + tempStateSet.add( table[states.nextElement()][input] ); 448 + 449 + newState.copy(tempStateSet); 450 + 451 + states.reset(tempStateSet); 452 + while ( states.hasMoreElements() ) 453 + newState.add( epsilon[states.nextElement()] ); 454 + 455 + // Out.debug("DFAEdge is : "+newState); 456 + 457 + 458 + if ( newState.containsElements() ) { 459 + 460 + // Out.debug("DFAEdge for input "+(int)input+" and state set "+currentState+" is "+newState); 461 + 462 + // Out.debug("Looking for state set "+newState); 463 + Integer nextDFAState = (Integer) dfaStates[newState]; 464 + 465 + if ( nextDFAState != null ) { 466 + // Out.debug("FOUND!"); 467 + dfa.addTransition(currentDFAState, input, nextDFAState.intValue()); 468 + } 469 + else { 470 + if (Options.progress) Out.print("."); 471 + // Out.debug("NOT FOUND!"); 472 + // Out.debug("Table was "+dfaStates); 473 + numDFAStates++; 474 + 475 + // make a new copy of newState to store in dfaStates 476 + StateSet storeState = new StateSet(newState); 477 + 478 + dfaStates[storeState] = new Integer(numDFAStates); 479 + dfaVector.Add(storeState); 480 + 481 + dfa.addTransition(currentDFAState, input, numDFAStates); 482 + dfa.setFinal( numDFAStates, containsFinal(storeState) ); 483 + dfa.setPushback( numDFAStates, containsPushback(storeState) ); 484 + dfa.setAction( numDFAStates, getAction(storeState) ); 485 + } 486 + } 487 + } 488 + 489 + currentDFAState++; 490 + } 491 + 492 + if (Options.verbose) Out.println(""); 493 + 494 + return dfa; 495 + } 496 + 497 + 498 + public void dumpTable() { 499 + Out.dump(ToString()); 500 + } 501 + 502 + public override String ToString() { 503 + StringBuilder result = new StringBuilder(); 504 + 505 + for (int i=0; i < numStates; i++) { 506 + result.Append("State"); 507 + if ( isFinal[i] ) result.Append("[FINAL]"); 508 + if ( isPushback[i] ) result.Append(" [PUSHBACK]"); 509 + result.AppendFormat(" {0}{1}", i, Out.NL); 510 + 511 + for (char input = (char)0; input < numInput; input++) { 512 + if ( table[i][input] != null && table[i][input].containsElements() ) 513 + result.AppendFormat(" with {0} in {1}{2}", (int)input, table[i][input], Out.NL); 514 + 515 + 516 + } 517 + 518 + if ( epsilon[i] != null && epsilon[i].containsElements() ) 519 + result.Append(" with epsilon in "+epsilon[i]+Out.NL); 520 + } 521 + 522 + return result.ToString(); 523 + } 524 + 525 + public void writeDot(File file) { 526 + try { 527 + StreamWriter writer = new StreamWriter(file); 528 + writer.WriteLine(dotFormat()); 529 + writer.Close(); 530 + } 531 + catch (IOException) { 532 + Out.error(ErrorMessages.FILE_WRITE, file); 533 + throw new GeneratorException(); 534 + } 535 + } 536 + 537 + public String dotFormat() { 538 + StringBuilder result = new StringBuilder(); 539 + 540 + result.Append("digraph NFA {").Append(Out.NL); 541 + result.Append("rankdir = LR").Append(Out.NL); 542 + 543 + for (int i=0; i < numStates; i++) { 544 + if ( isFinal[i] || isPushback[i] ) result.Append(i); 545 + if ( isFinal[i] ) result.Append(" [shape = doublecircle]"); 546 + if ( isPushback[i] ) result.Append(" [shape = box]"); 547 + if ( isFinal[i] || isPushback[i] ) result.Append(Out.NL); 548 + } 549 + 550 + for (int i=0; i < numStates; i++) { 551 + for (int input = 0; input < numInput; input++) { 552 + if ( table[i][input] != null ) { 553 + StateSetEnumerator states = table[i][input].states(); 554 + 555 + while (states.hasMoreElements()) { 556 + int s = states.nextElement(); 557 + result.AppendFormat("{0} -> {1}", i, s); 558 + result.AppendFormat(" [label=\"{0}\"]{1}", classes.ToString(input), Out.NL); 559 + } 560 + } 561 + } 562 + if ( epsilon[i] != null ) { 563 + StateSetEnumerator states = epsilon[i].states(); 564 + while (states.hasMoreElements()) { 565 + int s = states.nextElement(); 566 + result.AppendFormat("{0} -> {1} [style=dotted]{2}", i, s, Out.NL); 567 + } 568 + } 569 + } 570 + 571 + result.Append("}").Append(Out.NL); 572 + 573 + return result.ToString(); 574 + } 575 + 576 + 577 + //----------------------------------------------------------------------- 578 + // Functions for constructing NFAs out of regular expressions. 579 + 580 + private void insertLetterNFA(bool caseless, char letter, int start, int end) { 581 + if (caseless) { 582 + int lower = classes.getClassCode(char.ToLower(letter)); 583 + int upper = classes.getClassCode(char.ToUpper(letter)); 584 + addTransition(start, lower, end); 585 + if (upper != lower) addTransition(start, upper, end); 586 + } 587 + else { 588 + addTransition(start, classes.getClassCode(letter), end); 589 + } 590 + } 591 + 592 + private IntPair insertStringNFA(bool caseless, String letters) { 593 + int start = numStates; 594 + int i; 595 + 596 + for (i = 0; i < letters.Length; i++) { 597 + if (caseless) { 598 + char c = letters[i]; 599 + int lower = classes.getClassCode(char.ToLower(c)); 600 + int upper = classes.getClassCode(char.ToUpper(c)); 601 + addTransition(i+start, lower, i+start+1); 602 + if (upper != lower) addTransition(i+start, upper, i+start+1); 603 + } 604 + else { 605 + addTransition(i+start, classes.getClassCode(letters[i]), i+start+1); 606 + } 607 + } 608 + 609 + return new IntPair(start, i+start); 610 + } 611 + 612 + 613 + private void insertClassNFA(ArrayList intervalls, int start, int end) { 614 + // empty char class is ok: 615 + if (intervalls == null) return; 616 + 617 + int [] cl = classes.getClassCodes(intervalls); 618 + for (int i = 0; i < cl.Length; i++) 619 + addTransition(start, cl[i], end); 620 + } 621 + 622 + private void insertNotClassNFA(ArrayList intervalls, int start, int end) { 623 + int [] cl = classes.getNotClassCodes(intervalls); 624 + 625 + for (int i = 0; i < cl.Length; i++) 626 + addTransition(start, cl[i], end); 627 + } 628 + 629 + 630 + /** 631 + * Constructs an NFA accepting the complement of the language 632 + * of a given NFA. 633 + * 634 + * Converts the NFA into a DFA, then negates that DFA. 635 + * Exponential state blowup possible and common. 636 + * 637 + * @param the NFA to construct the complement for. 638 + * 639 + * @return a pair of integers denoting the index of start 640 + * and end state of the complement NFA. 641 + */ 642 + private IntPair complement(IntPair nfa) { 643 + 644 + if (Options.DEBUG) { 645 + Out.debug("complement for "+nfa); 646 + Out.debug("NFA is :"+Out.NL+this); 647 + } 648 + 649 + int dfaStart = nfa.end+1; 650 + 651 + // fixme: only need epsilon closure of states reachable from nfa.start 652 + epsilonFill(); 653 + 654 + Hashtable dfaStates = new PrettyHashtable(numStates); 655 + ArrayList dfaVector = new PrettyArrayList(numStates); 656 + 657 + int numDFAStates = 0; 658 + int currentDFAState = 0; 659 + 660 + StateSet currentState, newState; 661 + 662 + newState = epsilon[nfa.start]; 663 + dfaStates[newState] = new Integer(numDFAStates); 664 + dfaVector.Add(newState); 665 + 666 + if (Options.DEBUG) 667 + Out.debug("pos DFA start state is :"+Out.NL+dfaStates+Out.NL+Out.NL+"ordered :"+Out.NL+dfaVector); 668 + 669 + currentDFAState = 0; 670 + 671 + while ( currentDFAState <= numDFAStates ) { 672 + 673 + currentState = (StateSet) dfaVector[currentDFAState]; 674 + 675 + for (char input = (char)0; input < numInput; input++) { 676 + newState = DFAEdge(currentState, input); 677 + 678 + if ( newState.containsElements() ) { 679 + 680 + // Out.debug("DFAEdge for input "+(int)input+" and state set "+currentState+" is "+newState); 681 + 682 + // Out.debug("Looking for state set "+newState); 683 + Integer nextDFAState = (Integer) dfaStates[newState]; 684 + 685 + if ( nextDFAState != null ) { 686 + // Out.debug("FOUND!"); 687 + addTransition(dfaStart+currentDFAState, input, dfaStart+nextDFAState.intValue()); 688 + } 689 + else { 690 + if (Options.dump) Out.print("+"); 691 + // Out.debug("NOT FOUND!"); 692 + // Out.debug("Table was "+dfaStates); 693 + numDFAStates++; 694 + 695 + dfaStates[newState] = new Integer(numDFAStates); 696 + dfaVector.Add(newState); 697 + 698 + addTransition(dfaStart+currentDFAState, input, dfaStart+numDFAStates); 699 + } 700 + } 701 + } 702 + 703 + currentDFAState++; 704 + } 705 + 706 + // We have a dfa accepting the positive regexp. 707 + 708 + // Now the complement: 709 + if (Options.DEBUG) 710 + Out.debug("dfa finished, nfa is now :"+Out.NL+this); 711 + 712 + int start = dfaStart+numDFAStates+1; 713 + int error = dfaStart+numDFAStates+2; 714 + int end = dfaStart+numDFAStates+3; 715 + 716 + addEpsilonTransition(start, dfaStart); 717 + 718 + for (int i = 0; i < numInput; i++) 719 + addTransition(error, i, error); 720 + 721 + addEpsilonTransition(error, end); 722 + 723 + for (int s = 0; s <= numDFAStates; s++) { 724 + currentState = (StateSet) dfaVector[s]; 725 + 726 + currentDFAState = dfaStart+s; 727 + 728 + // if it was not a final state, it is now in the complement 729 + if (!currentState.isElement(nfa.end)) 730 + addEpsilonTransition(currentDFAState, end); 731 + 732 + // all inputs not present (formerly leading to an implicit error) 733 + // now lead to an explicit (final) state accepting everything. 734 + for (int i = 0; i < numInput; i++) 735 + if (table[currentDFAState][i] == null) 736 + addTransition(currentDFAState, i, error); 737 + } 738 + 739 + // eliminate transitions leading to dead states 740 + if (live == null || live.Length < numStates) { 741 + live = new bool [2*numStates]; 742 + visited = new bool [2*numStates]; 743 + } 744 + 745 + _end = end; 746 + _dfaStates = dfaVector; 747 + _dfaStart = dfaStart; 748 + removeDead(dfaStart); 749 + 750 + if (Options.DEBUG) 751 + Out.debug("complement finished, nfa ("+start+","+end+") is now :"+this); 752 + 753 + return new IntPair(start, end); 754 + } 755 + 756 + // "global" data for use in method removeDead only: 757 + // live[s] == false <=> no final state can be reached from s 758 + private bool [] live; // = new boolean [estSize]; 759 + private bool [] visited; // = new boolean [estSize]; 760 + private int _end; // final state of original nfa for dfa (nfa coordinates) 761 + private ArrayList _dfaStates; 762 + private int _dfaStart; // in nfa coordinates 763 + 764 + private void removeDead(int start) { 765 + // Out.debug("removeDead ("+start+")"); 766 + 767 + if ( visited[start] || live[start] ) return; 768 + visited[start] = true; 769 + 770 + // Out.debug("not yet visited"); 771 + 772 + if (closure(start).isElement(_end)) 773 + live[start] = true; 774 + 775 + // Out.debug("is final :"+live[start]); 776 + 777 + for (int i = 0; i < numInput; i++) { 778 + StateSet nextState = closure(table[start][i]); 779 + StateSetEnumerator states = nextState.states(); 780 + while (states.hasMoreElements()) { 781 + int next = states.nextElement(); 782 + 783 + if (next != start) { 784 + removeDead(next); 785 + 786 + if (live[next]) 787 + live[start] = true; 788 + else 789 + table[start][i] = null; 790 + } 791 + } 792 + } 793 + 794 + StateSet _nextState = closure(epsilon[start]); 795 + StateSetEnumerator _states = _nextState.states(); 796 + while (_states.hasMoreElements()) { 797 + int next = _states.nextElement(); 798 + 799 + if (next != start) { 800 + removeDead(next); 801 + 802 + if (live[next]) 803 + live[start] = true; 804 + } 805 + } 806 + 807 + // Out.debug("state "+start+" is live :"+live[start]); 808 + } 809 + 810 + 811 + /** 812 + * Constructs a two state NFA for char class regexps, 813 + * such that the NFA has 814 + * 815 + * exactly one start state, 816 + * exactly one end state, 817 + * no transitions leading out of the end state 818 + * no transitions leading into the start state 819 + * 820 + * Assumes that regExp.isCharClass(macros) == true 821 + * 822 + * @param regExp the regular expression to construct the 823 + * NFA for 824 + * 825 + * @return a pair of integers denoting the index of start 826 + * and end state of the NFA. 827 + */ 828 + private void insertNFA(RegExp regExp, int start, int end) { 829 + switch (regExp.type) { 830 + 831 + case sym.BAR: 832 + RegExp2 r = (RegExp2) regExp; 833 + insertNFA(r.r1, start, end); 834 + insertNFA(r.r2, start, end); 835 + return; 836 + 837 + case sym.CCLASS: 838 + insertClassNFA( (ArrayList) ((RegExp1) regExp).content, start, end); 839 + return; 840 + 841 + case sym.CCLASSNOT: 842 + insertNotClassNFA( (ArrayList) ((RegExp1) regExp).content, start, end); 843 + return; 844 + 845 + case sym.CHAR: 846 + insertLetterNFA( 847 + false, (char)((RegExp1) regExp).content, 848 + start, end); 849 + return; 850 + 851 + case sym.CHAR_I: 852 + insertLetterNFA( 853 + true, (char)((RegExp1) regExp).content, 854 + start, end); 855 + return; 856 + 857 + case sym.MACROUSE: 858 + insertNFA(macros.getDefinition((String) ((RegExp1) regExp).content), 859 + start, end); 860 + return; 861 + } 862 + 863 + throw new Exception("Unknown expression type "+regExp.type+" in NFA construction"); 864 + } 865 + 866 + 867 + /** 868 + * Constructs an NFA for regExp such that the NFA has 869 + * 870 + * exactly one start state, 871 + * exactly one end state, 872 + * no transitions leading out of the end state 873 + * no transitions leading into the start state 874 + * 875 + * @param regExp the regular expression to construct the 876 + * NFA for 877 + * 878 + * @return a pair of integers denoting the index of start 879 + * and end state of the NFA. 880 + */ 881 + public IntPair insertNFA(RegExp regExp) { 882 + 883 + IntPair nfa1, nfa2; 884 + int start, end; 885 + RegExp2 r; 886 + 887 + if (Options.DEBUG) 888 + Out.debug("Inserting RegExp : "+regExp); 889 + 890 + if (regExp.isCharClass(macros)) { 891 + start = numStates; 892 + end = numStates+1; 893 + 894 + ensureCapacity(end+1); 895 + if (end+1 > numStates) numStates = end+1; 896 + 897 + insertNFA(regExp, start, end); 898 + 899 + return new IntPair(start, end); 900 + } 901 + 902 + switch (regExp.type) { 903 + 904 + case sym.BAR: 905 + 906 + r = (RegExp2) regExp; 907 + 908 + nfa1 = insertNFA(r.r1); 909 + nfa2 = insertNFA(r.r2); 910 + 911 + start = nfa2.end+1; 912 + end = nfa2.end+2; 913 + 914 + addEpsilonTransition(start, nfa1.start); 915 + addEpsilonTransition(start, nfa2.start); 916 + addEpsilonTransition(nfa1.end, end); 917 + addEpsilonTransition(nfa2.end, end); 918 + 919 + return new IntPair(start, end); 920 + 921 + case sym.CONCAT: 922 + 923 + r = (RegExp2) regExp; 924 + 925 + nfa1 = insertNFA(r.r1); 926 + nfa2 = insertNFA(r.r2); 927 + 928 + addEpsilonTransition(nfa1.end, nfa2.start); 929 + 930 + return new IntPair(nfa1.start, nfa2.end); 931 + 932 + case sym.STAR: 933 + nfa1 = insertNFA( (RegExp) ((RegExp1) regExp).content ); 934 + 935 + start = nfa1.end+1; 936 + end = nfa1.end+2; 937 + 938 + addEpsilonTransition(nfa1.end, end); 939 + addEpsilonTransition(start, nfa1.start); 940 + 941 + addEpsilonTransition(start, end); 942 + addEpsilonTransition(nfa1.end, nfa1.start); 943 + 944 + return new IntPair(start, end); 945 + 946 + case sym.PLUS: 947 + nfa1 = insertNFA( (RegExp) ((RegExp1) regExp).content ); 948 + 949 + start = nfa1.end+1; 950 + end = nfa1.end+2; 951 + 952 + addEpsilonTransition(nfa1.end, end); 953 + addEpsilonTransition(start, nfa1.start); 954 + 955 + addEpsilonTransition(nfa1.end, nfa1.start); 956 + 957 + return new IntPair(start, end); 958 + 959 + case sym.QUESTION: 960 + nfa1 = insertNFA( (RegExp) ((RegExp1) regExp).content ); 961 + 962 + addEpsilonTransition(nfa1.start, nfa1.end); 963 + 964 + return new IntPair(nfa1.start, nfa1.end); 965 + 966 + case sym.BANG: 967 + return complement(insertNFA((RegExp) ((RegExp1) regExp).content)); 968 + 969 + case sym.TILDE: 970 + nfa1 = insertNFA((RegExp) ((RegExp1) regExp).content); 971 + 972 + start = nfa1.end+1; 973 + int s1 = start+1; 974 + int s2 = s1+1; 975 + end = s2+1; 976 + 977 + for (int i = 0; i < numInput; i++) { 978 + addTransition(s1,i,s1); 979 + addTransition(s2,i,s2); 980 + } 981 + 982 + addEpsilonTransition(start, s1); 983 + addEpsilonTransition(s1, nfa1.start); 984 + addEpsilonTransition(nfa1.end, s2); 985 + addEpsilonTransition(s2, end); 986 + 987 + nfa1 = complement(new IntPair(start,end)); 988 + nfa2 = insertNFA((RegExp) ((RegExp1) regExp).content); 989 + 990 + addEpsilonTransition(nfa1.end, nfa2.start); 991 + 992 + return new IntPair(nfa1.start, nfa2.end); 993 + 994 + case sym.STRING: 995 + return insertStringNFA(false, (String) ((RegExp1) regExp).content ); 996 + 997 + case sym.STRING_I: 998 + return insertStringNFA(true, (String) ((RegExp1) regExp).content ); 999 + 1000 + case sym.MACROUSE: 1001 + return insertNFA(macros.getDefinition((String) ((RegExp1) regExp).content)); 1002 + } 1003 + 1004 + throw new Exception("Unknown expression type "+regExp.type+" in NFA construction"); 1005 + } 1006 + } 1007 + }
+93
CSFlex/Core/Options.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + 27 + // Modified in July 2026 by the Prexonite contributors to reset all mutable 28 + // generator state between Roslyn invocations. See COPYRIGHT. 29 + 30 + namespace CSFlex 31 + { 32 + 33 + /** 34 + * Collects all global C# Flex options. Can be set from command line parser, 35 + * ant taks, gui, etc. 36 + * 37 + * @author Gerwin Klein 38 + * @version JFlex 1.4, $Revision: 2.9 $, $Date: 2004/04/12 10:07:47 $ 39 + * @author Jonathan Gilbert 40 + * @version CSFlex 1.4 41 + */ 42 + public class Options { 43 + 44 + /** If true, additional verbose debug information is produced 45 + * This is a compile time option */ 46 + public static readonly bool DEBUG = false; 47 + 48 + /** code generation method: maximum packing */ 49 + public const int PACK = 0; 50 + /** code generation method: traditional */ 51 + public const int TABLE = 1; 52 + /** code generation method: switch statement */ 53 + public const int SWITCH = 2; 54 + 55 + 56 + /** strict JLex compatibility */ 57 + public static bool jlex; 58 + /** don't run minimization algorithm if this is true */ 59 + public static bool no_minimize; 60 + /** default code generation method */ 61 + public static int gen_method; 62 + /** If false, only error/warning output will be generated */ 63 + public static bool verbose; 64 + /** If true, progress dots will be printed */ 65 + public static bool progress; 66 + /** If true, C# Flex will print time statistics about the generation process */ 67 + public static bool time; 68 + /** If true, C# Flex will write graphviz .dot files for generated automata */ 69 + public static bool dot; 70 + /** If true, you will be flooded with information (e.g. dfa tables). */ 71 + public static bool dump; 72 + /** If true, the output will be C# code instead of Java. */ 73 + public static bool emit_csharp; 74 + 75 + static Options() { setDefaults(); } 76 + 77 + 78 + /** 79 + * Sets all options back to default values. 80 + */ 81 + public static void setDefaults() { 82 + jlex = false; 83 + no_minimize = false; 84 + gen_method = Options.PACK; 85 + verbose = true; 86 + progress = true; 87 + time = false; 88 + dot = false; 89 + dump = false; 90 + emit_csharp = false; 91 + } 92 + } 93 + }
+81
CSFlex/Core/Out.cs
··· 1 + /* 2 + * C# Flex 1.4 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> 4 + * Derived from JFlex 1.4, Copyright (C) 1998-2004 Gerwin Klein. 5 + * 6 + * Modified in July 2026 by the Prexonite contributors: replaced the 7 + * WinForms/console output layer with an in-memory diagnostic collector. 8 + * Distributed under GNU GPL version 2; see ../COPYRIGHT. 9 + */ 10 + 11 + namespace CSFlex; 12 + 13 + internal enum GenerationDiagnosticSeverity 14 + { 15 + Warning, 16 + Error 17 + } 18 + 19 + internal sealed record GenerationDiagnostic( 20 + GenerationDiagnosticSeverity Severity, 21 + string Message, 22 + string Path = null, 23 + int Line = -1, 24 + int Column = -1); 25 + 26 + public sealed class Out 27 + { 28 + public static readonly string NL = Environment.NewLine; 29 + 30 + static readonly List<GenerationDiagnostic> diagnostics = new(); 31 + static int errors; 32 + 33 + internal static IReadOnlyList<GenerationDiagnostic> Diagnostics => diagnostics; 34 + 35 + public static void resetCounters() 36 + { 37 + diagnostics.Clear(); 38 + errors = 0; 39 + } 40 + 41 + public static void checkErrors() 42 + { 43 + if (errors > 0) 44 + throw new GeneratorException(); 45 + } 46 + 47 + public static void error(string message) => AddError(message); 48 + public static void error(ErrorMessages message) => AddError(ErrorMessages.get(message)); 49 + public static void error(ErrorMessages message, string data) => 50 + AddError(ErrorMessages.get(message, data)); 51 + public static void error(ErrorMessages message, File file) => 52 + AddError(ErrorMessages.get(message), file); 53 + public static void error(File file, ErrorMessages message, int line, int column) => 54 + AddError(ErrorMessages.get(message), file, line, column); 55 + 56 + public static void warning(string message) => AddWarning(message); 57 + public static void warning(ErrorMessages message, int line) => 58 + AddWarning(ErrorMessages.get(message), null, line, -1); 59 + public static void warning(File file, ErrorMessages message, int line, int column) => 60 + AddWarning(ErrorMessages.get(message), file, line, column); 61 + 62 + static void AddError(string message, File file = null, int line = -1, int column = -1) 63 + { 64 + errors++; 65 + diagnostics.Add(new GenerationDiagnostic( 66 + GenerationDiagnosticSeverity.Error, message, file?.ToString(), line, column)); 67 + } 68 + 69 + static void AddWarning(string message, File file = null, int line = -1, int column = -1) => 70 + diagnostics.Add(new GenerationDiagnostic( 71 + GenerationDiagnosticSeverity.Warning, message, file?.ToString(), line, column)); 72 + 73 + public static void debug(string message) { } 74 + public static void dump(string message) { } 75 + public static void print(string message) { } 76 + public static void println(string message) { } 77 + public static void println(ErrorMessages message, string data) { } 78 + public static void println(ErrorMessages message, int data) { } 79 + public static void time(string message) { } 80 + public static void time(ErrorMessages message, Timer timer) { } 81 + }
+296
CSFlex/Core/PackEmitter.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + using System.Text; 27 + 28 + namespace CSFlex 29 + { 30 + 31 + 32 + /** 33 + * Encodes <code>int</code> arrays as strings. 34 + * 35 + * Also splits up strings when longer than 64K in UTF8 encoding. 36 + * Subclasses emit unpacking code. 37 + * 38 + * Usage protocol: 39 + * <code>p.emitInit();</code><br> 40 + * <code>for each data: p.emitData(data);</code><br> 41 + * <code>p.emitUnpack();</code> 42 + * 43 + * @author Gerwin Klein 44 + * @version $Revision: 1.6 $, $Date: 2004/04/12 10:07:47 $ 45 + */ 46 + public abstract class PackEmitter { 47 + 48 + /** name of the generated array (mixed case, no yy prefix) */ 49 + protected String name; 50 + 51 + /** current UTF8 length of generated string in current chunk */ 52 + private int _UTF8Length; 53 + 54 + /** position in the current line */ 55 + private int linepos; 56 + 57 + /** max number of entries per line */ 58 + private const int maxEntries = 16; 59 + 60 + /** output buffer */ 61 + protected StringBuilder @out = new StringBuilder(); 62 + 63 + /** number of existing string chunks */ 64 + protected int chunks; 65 + 66 + /** maximum size of chunks */ 67 + // String constants are stored as UTF8 with 2 bytes length 68 + // field in class files. One Unicode char can be up to 3 69 + // UTF8 bytes. 64K max and two chars safety. 70 + private const int maxSize = 0xFFFF-6; 71 + 72 + /** indent for string lines */ 73 + private const String indent = " "; 74 + private const String csharp_indent = " "; 75 + 76 + /** 77 + * Create new emitter for an array. 78 + * 79 + * @param name the name of the generated array 80 + */ 81 + public PackEmitter(String name) { 82 + this.name = name; 83 + } 84 + 85 + /** 86 + * Convert array name into all uppercase internal scanner 87 + * constant name. 88 + * 89 + * @return <code>name</code> as a internal constant name. 90 + * @see PackEmitter#name 91 + */ 92 + protected String constName() { 93 + return "ZZ_" + name.ToUpper(); 94 + } 95 + 96 + /** 97 + * Return current output buffer. 98 + */ 99 + public override String ToString() { 100 + return @out.ToString(); 101 + } 102 + 103 + /** 104 + * Emit declaration of decoded member and open first chunk. 105 + */ 106 + public void emitInit() { 107 + if (Options.emit_csharp) 108 + { 109 + @out.Append(" private static readonly int [] "); 110 + @out.Append(constName()); 111 + @out.Append(";"); 112 + } 113 + else 114 + { 115 + @out.Append(" private static final int [] "); 116 + @out.Append(constName()); 117 + @out.Append(" = zzUnpack"); 118 + @out.Append(name); 119 + @out.Append("();"); 120 + } 121 + nl(); 122 + nextChunk(); 123 + } 124 + 125 + /** 126 + * Emit single unicode character. 127 + * 128 + * Updates length, position, etc. 129 + * 130 + * @param i the character to emit. 131 + * @prec 0 <= i <= 0xFFFF 132 + */ 133 + public void emitUC(int i) { 134 + if (i < 0 || i > 0xFFFF) 135 + throw new ArgumentException("character value expected", "i"); 136 + 137 + // cast ok because of prec 138 + char c = (char) i; 139 + 140 + printUC(c); 141 + _UTF8Length += UTF8Length(c); 142 + linepos++; 143 + } 144 + 145 + /** 146 + * Execute line/chunk break if necessary. 147 + * Leave space for at least two chars. 148 + */ 149 + public void breaks() { 150 + if (_UTF8Length >= maxSize) { 151 + // close current chunk 152 + if (Options.emit_csharp) 153 + @out.Append("0 };"); 154 + else 155 + @out.Append("\";"); 156 + nl(); 157 + 158 + nextChunk(); 159 + } 160 + else { 161 + if (linepos >= maxEntries) { 162 + // line break 163 + if (Options.emit_csharp) 164 + { 165 + nl(); 166 + @out.Append(csharp_indent); 167 + } 168 + else 169 + { 170 + @out.Append("\"+"); 171 + nl(); 172 + @out.Append(indent); 173 + @out.Append("\""); 174 + } 175 + linepos = 0; 176 + } 177 + } 178 + } 179 + 180 + /** 181 + * Emit the unpacking code. 182 + */ 183 + public abstract void emitUnpack(); 184 + 185 + /** 186 + * emit next chunk 187 + */ 188 + private void nextChunk() { 189 + if (Options.emit_csharp) 190 + { 191 + nl(); 192 + @out.Append(" private static readonly ushort[] "); 193 + @out.Append(constName()); 194 + @out.Append("_PACKED_"); 195 + @out.Append(chunks); 196 + @out.Append(" = new ushort[] {"); 197 + nl(); 198 + @out.Append(csharp_indent); 199 + } 200 + else 201 + { 202 + nl(); 203 + @out.Append(" private static final String "); 204 + @out.Append(constName()); 205 + @out.Append("_PACKED_"); 206 + @out.Append(chunks); 207 + @out.Append(" ="); 208 + nl(); 209 + @out.Append(indent); 210 + @out.Append("\""); 211 + } 212 + 213 + _UTF8Length = 0; 214 + linepos = 0; 215 + chunks++; 216 + } 217 + 218 + /** 219 + * emit newline 220 + */ 221 + protected void nl() { 222 + @out.Append(Out.NL); 223 + } 224 + 225 + /** 226 + * Append a unicode/octal escaped character 227 + * to <code>out</code> buffer. 228 + * 229 + * @param c the character to append 230 + */ 231 + private void printUC(char c) { 232 + if (Options.emit_csharp) 233 + @out.Append(" "); 234 + 235 + if (c > 255) 236 + { 237 + if (Options.emit_csharp) 238 + { 239 + @out.Append("0x"); 240 + if (c < 0x1000) @out.Append("0"); 241 + @out.Append(Integer.toHexString(c)); 242 + } 243 + else 244 + { 245 + @out.Append("\\u"); 246 + if (c < 0x1000) @out.Append("0"); 247 + @out.Append(Integer.toHexString(c)); 248 + } 249 + } 250 + else 251 + { 252 + if (Options.emit_csharp) 253 + @out.Append(((int)c).ToString()); 254 + else 255 + { 256 + @out.Append("\\"); 257 + @out.Append(Integer.toOctalString(c)); 258 + } 259 + } 260 + 261 + if (Options.emit_csharp) 262 + @out.Append(","); 263 + } 264 + 265 + /** 266 + * Calculates the number of bytes a Unicode character 267 + * would have in UTF8 representation in a class file. 268 + * 269 + * @param value the char code of the Unicode character 270 + * @prec 0 <= value <= 0xFFFF 271 + * 272 + * @return length of UTF8 representation. 273 + */ 274 + private int UTF8Length(char value) { 275 + // if (value < 0 || value > 0xFFFF) throw new Error("not a char value ("+value+")"); 276 + 277 + // see JVM spec §4.4.7, p 111 278 + if (value == 0) return 2; 279 + if (value <= 0x7F) return 1; 280 + 281 + // workaround for javac bug (up to jdk 1.3): 282 + if (value < 0x0400) return 2; 283 + if (value <= 0x07FF) return 3; 284 + 285 + // correct would be: 286 + // if (value <= 0x7FF) return 2; 287 + return 3; 288 + } 289 + 290 + // convenience 291 + protected void println(String s) { 292 + @out.Append(s); 293 + nl(); 294 + } 295 + } 296 + }
+182
CSFlex/Core/RegExp.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + 27 + namespace CSFlex 28 + { 29 + 30 + 31 + /** 32 + * Stores a regular expression of rules section in a C# Flex specification. 33 + * 34 + * This base class has no content other than its type. 35 + * 36 + * @author Gerwin Klein 37 + * @version JFlex 1.4, $Revision: 2.3 $, $Date: 2004/04/12 10:07:47 $ 38 + * @author Jonathan Gilbert 39 + * @version CSFlex 1.4 40 + */ 41 + public class RegExp { 42 + 43 + /** 44 + * The type of the regular expression. This field will be 45 + * filled with values from class sym.java (generated by cup) 46 + */ 47 + internal int type; 48 + 49 + 50 + /** 51 + * Create a new regular expression of the specified type. 52 + * 53 + * @param type a value from the cup generated class sym. 54 + * 55 + * @see CSFlex.sym 56 + */ 57 + public RegExp(int type) { 58 + this.type = type; 59 + } 60 + 61 + 62 + 63 + /** 64 + * Returns a String-representation of this regular expression 65 + * with the specified indentation. 66 + * 67 + * @param tab a String that should contain only space characters and 68 + * that is inserted in front of standard String-representation 69 + * pf this object. 70 + */ 71 + public virtual String print(String tab) { 72 + return tab+ToString(); 73 + } 74 + 75 + 76 + /** 77 + * Returns a String-representation of this regular expression 78 + */ 79 + public override String ToString() { 80 + return "type = "+type; 81 + } 82 + 83 + 84 + /** 85 + * Find out if this regexp is a char class or equivalent to one. 86 + * 87 + * @param macros for macro expansion 88 + * @return true if the regexp is equivalent to a char class. 89 + */ 90 + public bool isCharClass(Macros macros) { 91 + RegExp1 unary; 92 + RegExp2 binary; 93 + 94 + switch (type) { 95 + case sym.CHAR: 96 + case sym.CHAR_I: 97 + case sym.CCLASS: 98 + case sym.CCLASSNOT: 99 + return true; 100 + 101 + case sym.BAR: 102 + binary = (RegExp2) this; 103 + return binary.r1.isCharClass(macros) && binary.r2.isCharClass(macros); 104 + 105 + case sym.MACROUSE: 106 + unary = (RegExp1) this; 107 + return macros.getDefinition((String) unary.content).isCharClass(macros); 108 + 109 + default: return false; 110 + } 111 + } 112 + 113 + /** 114 + * The approximate number of NFA states this expression will need (only 115 + * works correctly after macro expansion and without negation) 116 + * 117 + * @param macros macro table for expansion 118 + */ 119 + public int size(Macros macros) { 120 + RegExp1 unary; 121 + RegExp2 binary; 122 + RegExp content; 123 + 124 + switch ( type ) { 125 + case sym.BAR: 126 + binary = (RegExp2) this; 127 + return binary.r1.size(macros) + binary.r2.size(macros) + 2; 128 + 129 + case sym.CONCAT: 130 + binary = (RegExp2) this; 131 + return binary.r1.size(macros) + binary.r2.size(macros); 132 + 133 + case sym.STAR: 134 + unary = (RegExp1) this; 135 + content = (RegExp) unary.content; 136 + return content.size(macros) + 2; 137 + 138 + case sym.PLUS: 139 + unary = (RegExp1) this; 140 + content = (RegExp) unary.content; 141 + return content.size(macros) + 2; 142 + 143 + case sym.QUESTION: 144 + unary = (RegExp1) this; 145 + content = (RegExp) unary.content; 146 + return content.size(macros); 147 + 148 + case sym.BANG: 149 + unary = (RegExp1) this; 150 + content = (RegExp) unary.content; 151 + return content.size(macros) * content.size(macros); 152 + // this is only a very rough estimate (worst case 2^n) 153 + // exact size too complicated (propably requires construction) 154 + 155 + case sym.TILDE: 156 + unary = (RegExp1) this; 157 + content = (RegExp) unary.content; 158 + return content.size(macros) * content.size(macros) * 3; 159 + // see sym.BANG 160 + 161 + case sym.STRING: 162 + case sym.STRING_I: 163 + unary = (RegExp1) this; 164 + return ((String) unary.content).Length+1; 165 + 166 + case sym.CHAR: 167 + case sym.CHAR_I: 168 + return 2; 169 + 170 + case sym.CCLASS: 171 + case sym.CCLASSNOT: 172 + return 2; 173 + 174 + case sym.MACROUSE: 175 + unary = (RegExp1) this; 176 + return macros.getDefinition((String) unary.content).size(macros); 177 + } 178 + 179 + throw new Exception("unknown regexp type "+type); 180 + } 181 + } 182 + }
+89
CSFlex/Core/RegExp1.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + 27 + namespace CSFlex 28 + { 29 + 30 + 31 + /** 32 + * Stores a regular expression from the rules section of a C# Flex specification. 33 + * 34 + * This class provides storage for one Object of content. 35 + * It is used for all regular expressions that are constructed from one object. 36 + * 37 + * For instance: a* is new RegExp1(sym.STAR, new Character ('a')); 38 + * 39 + * @author Gerwin Klein 40 + * @version JFlex 1.4, $Revision: 2.1 $, $Date: 2004/04/12 10:07:48 $ 41 + * @author Jonathan Gilbert 42 + * @version CSFlex 1.4 43 + */ 44 + public class RegExp1: RegExp { 45 + 46 + /** 47 + * The child of this expression node in the syntax tree of a regular expression. 48 + */ 49 + internal Object content; 50 + 51 + 52 + /** 53 + * Constructs a new regular expression with one child object. 54 + * 55 + * @param type a value from the cup generated class sym, defining the 56 + * kind of this regular expression 57 + * 58 + * @param content the child of this expression 59 + */ 60 + public RegExp1(int type, Object content) : base(type) { 61 + this.content = content; 62 + } 63 + 64 + 65 + /** 66 + * Returns a String-representation of this regular expression 67 + * with the specified indentation. 68 + * 69 + * @param tab a String that should contain only space characters and 70 + * that is inserted in front of standard String-representation 71 + * pf this object. 72 + */ 73 + public override String print(String tab) { 74 + if (content is RegExp) { 75 + return tab+"type = "+type+Out.NL+tab+"content :"+Out.NL+((RegExp)content).print(tab+" "); 76 + } 77 + else 78 + return tab+"type = "+type+Out.NL+tab+"content :"+Out.NL+tab+" "+content; 79 + } 80 + 81 + 82 + /** 83 + * Returns a String-representation of this regular expression 84 + */ 85 + public override String ToString() { 86 + return print(""); 87 + } 88 + } 89 + }
+59
CSFlex/Core/RegExp2.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + 27 + namespace CSFlex 28 + { 29 + 30 + 31 + /** 32 + * Regular expression with two children (e.g. a | b) 33 + * 34 + * @author Gerwin Klein 35 + * @version JFlex 1.4, $Revision: 2.2 $, $Date: 2004/04/12 10:07:48 $ 36 + * @author Jonathan Gilbert 37 + * @version CSFlex 1.4 38 + */ 39 + public class RegExp2: RegExp { 40 + 41 + internal RegExp r1, r2; 42 + 43 + public RegExp2(int type, RegExp r1, RegExp r2) : base(type) { 44 + this.r1 = r1; 45 + this.r2 = r2; 46 + } 47 + 48 + public override String print(String tab) { 49 + return tab+"type = "+type+Out.NL+tab+"child 1 :"+Out.NL+ //$NON-NLS-1$ //$NON-NLS-2$ 50 + r1.print(tab+" ")+Out.NL+tab+"child 2 :"+Out.NL+ //$NON-NLS-1$ //$NON-NLS-2$ 51 + r2.print(tab+" "); //$NON-NLS-1$ 52 + } 53 + 54 + public override String ToString() { 55 + return print(""); //$NON-NLS-1$ 56 + } 57 + } 58 + 59 + }
+166
CSFlex/Core/RegExps.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + using System; 25 + using System.Collections; 26 + 27 + namespace CSFlex 28 + { 29 + 30 + /** 31 + * Stores all rules of the specification for later access in RegExp -> NFA 32 + * 33 + * @author Gerwin Klein 34 + * @version JFlex 1.4, $Revision: 2.3 $, $Date: 2004/04/12 10:07:48 $ 35 + * @author Jonathan Gilbert 36 + * @version CSFlex 1.4 37 + */ 38 + public class RegExps { 39 + 40 + /** the spec line in which a regexp is used */ 41 + ArrayList /* of Integer */ lines; 42 + 43 + /** the lexical states in wich the regexp is used */ 44 + ArrayList /* of ArrayList of Integer */ states; 45 + 46 + /** the regexp */ 47 + ArrayList /* of RegExp */ regExps; 48 + 49 + /** the action of a regexp */ 50 + ArrayList /* of Action */ actions; 51 + 52 + /** flag if it is a BOL regexp */ 53 + ArrayList /* of Boolean */ BOL; 54 + 55 + /** the lookahead expression */ 56 + ArrayList /* of RegExp */ look; 57 + 58 + public RegExps() { 59 + states = new PrettyArrayList(); 60 + regExps = new PrettyArrayList(); 61 + actions = new PrettyArrayList(); 62 + BOL = new PrettyArrayList(); 63 + look = new PrettyArrayList(); 64 + lines = new PrettyArrayList(); 65 + } 66 + 67 + public int insert(int line, ArrayList stateList, RegExp regExp, Action action, 68 + Boolean isBOL, RegExp lookAhead) { 69 + if (Options.DEBUG) { 70 + Out.debug("Inserting regular expression with statelist :"+Out.NL+stateList); //$NON-NLS-1$ 71 + Out.debug("and action code :"+Out.NL+action.content+Out.NL); //$NON-NLS-1$ 72 + Out.debug("expression :"+Out.NL+regExp); //$NON-NLS-1$ 73 + } 74 + 75 + states.Add(stateList); 76 + regExps.Add(regExp); 77 + actions.Add(action); 78 + BOL.Add(isBOL); 79 + look.Add(lookAhead); 80 + lines.Add(line); 81 + 82 + return states.Count-1; 83 + } 84 + 85 + public int insert(ArrayList stateList, Action action) { 86 + 87 + if (Options.DEBUG) { 88 + Out.debug("Inserting eofrule with statelist :"+Out.NL+stateList); //$NON-NLS-1$ 89 + Out.debug("and action code :"+Out.NL+action.content+Out.NL); //$NON-NLS-1$ 90 + } 91 + 92 + states.Add(stateList); 93 + regExps.Add(null); 94 + actions.Add(action); 95 + BOL.Add(null); 96 + look.Add(null); 97 + lines.Add(null); 98 + 99 + return states.Count-1; 100 + } 101 + 102 + public void addStates(int regNum, ArrayList newStates) { 103 + IEnumerator s = newStates.GetEnumerator(); 104 + 105 + while (s.MoveNext()) 106 + ((ArrayList)states[regNum]).Add(s.Current); 107 + } 108 + 109 + public int getNum() { 110 + return states.Count; 111 + } 112 + 113 + public bool isBOL(int num) { 114 + return ((Boolean) BOL[num]).booleanValue(); 115 + } 116 + 117 + public RegExp getLookAhead(int num) { 118 + return (RegExp) look[num]; 119 + } 120 + 121 + public bool isEOF(int num) { 122 + return BOL[num] == null; 123 + } 124 + 125 + public ArrayList getStates(int num) { 126 + return (ArrayList) states[num]; 127 + } 128 + 129 + public RegExp getRegExp(int num) { 130 + return (RegExp) regExps[num]; 131 + } 132 + 133 + public int getLine(int num) { 134 + return ((Integer) lines[num]).intValue(); 135 + } 136 + 137 + public void checkActions() { 138 + if ( actions[actions.Count-1] == null ) { 139 + Out.error(ErrorMessages.NO_LAST_ACTION); 140 + throw new GeneratorException(); 141 + } 142 + } 143 + 144 + public Action getAction(int num) { 145 + while ( num < actions.Count && actions[num] == null ) 146 + num++; 147 + 148 + return (Action) actions[num]; 149 + } 150 + 151 + public int NFASize(Macros macros) { 152 + int size = 0; 153 + IEnumerator e = regExps.GetEnumerator(); 154 + while (e.MoveNext()) { 155 + RegExp r = (RegExp) e.Current; 156 + if (r != null) size += r.size(macros); 157 + } 158 + e = look.GetEnumerator(); 159 + while (e.MoveNext()) { 160 + RegExp r = (RegExp) e.Current; 161 + if (r != null) size += r.size(macros); 162 + } 163 + return size; 164 + } 165 + } 166 + }
+119
CSFlex/Core/ScannerException.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + using System.IO; 27 + 28 + namespace CSFlex 29 + { 30 + 31 + /** 32 + * This Exception could be thrown while scanning the specification 33 + * (e.g. unmatched input) 34 + * 35 + * @author Gerwin Klein 36 + * @version JFlex 1.4, $Revision: 2.2 $, $Date: 2004/04/12 10:07:47 $ 37 + * @author Jonathan Gilbert 38 + * @version CSFlex 1.4 39 + */ 40 + public class ScannerException: RuntimeException { 41 + 42 + public int line; 43 + public int column; 44 + public ErrorMessages message; 45 + public File file; 46 + 47 + private ScannerException(File file, String text, ErrorMessages message, int line, int column) 48 + : base(text) 49 + { 50 + this.file = file; 51 + this.message = message; 52 + this.line = line; 53 + this.column = column; 54 + } 55 + 56 + 57 + /** 58 + * Creates a new ScannerException with a message only. 59 + * 60 + * @param message the code for the error description presented to the user. 61 + */ 62 + public ScannerException(ErrorMessages message) 63 + : this( null, ErrorMessages.get(message), message, -1, -1 ) 64 + { 65 + } 66 + 67 + /** 68 + * Creates a new ScannerException for a file with a message only. 69 + * 70 + * @param file the file in which the error occured 71 + * @param message the code for the error description presented to the user. 72 + */ 73 + public ScannerException(File file, ErrorMessages message) 74 + : this( file, ErrorMessages.get(message), message, -1, -1 ) 75 + { 76 + } 77 + 78 + 79 + /** 80 + * Creates a new ScannerException with a message and line number. 81 + * 82 + * @param message the code for the error description presented to the user. 83 + * @param line the number of the line in the specification that 84 + * contains the error 85 + */ 86 + public ScannerException(ErrorMessages message, int line) 87 + : this( null, ErrorMessages.get(message), message, line, -1 ) 88 + { 89 + } 90 + 91 + 92 + /** 93 + * Creates a new ScannerException for a file with a message and line number. 94 + * 95 + * @param message the code for the error description presented to the user. 96 + * @param line the number of the line in the specification that 97 + * contains the error 98 + */ 99 + public ScannerException(File file, ErrorMessages message, int line) 100 + : this( file, ErrorMessages.get(message), message, line, -1 ) 101 + { 102 + } 103 + 104 + 105 + /** 106 + * Creates a new ScannerException with a message, line number and column. 107 + * 108 + * @param message the code for the error description presented to the user. 109 + * @param line the number of the line in the specification that 110 + * contains the error 111 + * @param column the column where the error starts 112 + */ 113 + public ScannerException(File file, ErrorMessages message, int line, int column) 114 + : this( file, ErrorMessages.get(message), message, line, column ) 115 + { 116 + } 117 + 118 + } 119 + }
+296
CSFlex/Core/SemCheck.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + using System; 25 + using System.Collections; 26 + using System.IO; 27 + 28 + namespace CSFlex 29 + { 30 + 31 + /** 32 + * Performs simple semantic analysis on regular expressions. 33 + * 34 + * (used for checking if trailing contexts are legal) 35 + * 36 + * @author Gerwin Klein 37 + * @version JFlex 1.4, $Revision: 2.3 $, $Date: 2004/04/12 10:07:48 $ 38 + * @author Jonathan Gilbert 39 + * @version CSFlex 1.4 40 + */ 41 + public sealed class SemCheck { 42 + 43 + // stored globally since they are used as constants in all checks 44 + private static Macros macros; 45 + private static char maxChar; 46 + 47 + 48 + /** 49 + * Performs semantic analysis for all expressions. 50 + * 51 + * Currently: illegal lookahead check only 52 + * [fixme: more checks possible] 53 + * 54 + * @param rs the reg exps to be checked 55 + * @param m the macro table (in expanded form) 56 + * @param max max character of the used charset (for negation) 57 + * @param f the spec file containing the rules [fixme] 58 + */ 59 + public static void check(RegExps rs, Macros m, char max, File f) { 60 + macros = m; 61 + maxChar = max; 62 + 63 + bool errors = false; 64 + int num = rs.getNum(); 65 + for (int i = 0; i < num; i++) { 66 + RegExp r = rs.getRegExp(i); 67 + RegExp l = rs.getLookAhead(i); 68 + 69 + if (!checkLookAhead(r,l)) { 70 + errors = true; 71 + Out.error(f, ErrorMessages.LOOKAHEAD_ERROR, rs.getLine(i), -1); 72 + } 73 + } 74 + 75 + if (errors) throw new GeneratorException(); 76 + } 77 + 78 + 79 + /** 80 + * Checks for illegal lookahead expressions. 81 + * 82 + * Lookahead in C# Flex only works when the first expression has fixed 83 + * length or when the intersection of the last set of the first expression 84 + * and the first set of the second expression is empty. 85 + * 86 + * @param r1 first regexp 87 + * @param r2 second regexp (the lookahead) 88 + * 89 + * @return true iff C# Flex can generate code for the lookahead expression 90 + */ 91 + private static bool checkLookAhead(RegExp r1, RegExp r2) { 92 + return r2 == null || length(r1) > 0 || !(last(r1).and(first(r2)).containsElements()); 93 + } 94 + 95 + 96 + /** 97 + * Returns length if expression has fixed length, -1 otherwise. 98 + */ 99 + private static int length(RegExp re) { 100 + RegExp2 r; 101 + 102 + switch (re.type) { 103 + 104 + case sym.BAR: { 105 + r = (RegExp2) re; 106 + int l1 = length(r.r1); 107 + if (l1 < 0) return -1; 108 + int l2 = length(r.r2); 109 + 110 + if (l1 == l2) 111 + return l1; 112 + else 113 + return -1; 114 + } 115 + 116 + case sym.CONCAT: { 117 + r = (RegExp2) re; 118 + int l1 = length(r.r1); 119 + if (l1 < 0) return -1; 120 + int l2 = length(r.r2); 121 + if (l2 < 0) return -1; 122 + return l1+l2; 123 + } 124 + 125 + case sym.STAR: 126 + case sym.PLUS: 127 + case sym.QUESTION: 128 + return -1; 129 + 130 + case sym.CCLASS: 131 + case sym.CCLASSNOT: 132 + case sym.CHAR: 133 + return 1; 134 + 135 + case sym.STRING: { 136 + String content = (String) ((RegExp1) re).content; 137 + return content.Length; 138 + } 139 + 140 + case sym.MACROUSE: 141 + return length(macros.getDefinition((String) ((RegExp1) re).content)); 142 + } 143 + 144 + throw new Exception("Unkown expression type "+re.type+" in "+re); //$NON-NLS-1$ //$NON-NLS-2$ 145 + } 146 + 147 + 148 + /** 149 + * Returns true iff the matched language contains epsilon 150 + */ 151 + private static bool containsEpsilon(RegExp re) { 152 + RegExp2 r; 153 + 154 + switch (re.type) { 155 + 156 + case sym.BAR: 157 + r = (RegExp2) re; 158 + return containsEpsilon(r.r1) || containsEpsilon(r.r2); 159 + 160 + case sym.CONCAT: 161 + r = (RegExp2) re; 162 + if (containsEpsilon(r.r1)) 163 + return containsEpsilon(r.r2); 164 + else 165 + return false; 166 + 167 + case sym.STAR: 168 + case sym.QUESTION: 169 + return true; 170 + 171 + case sym.PLUS: 172 + return containsEpsilon( (RegExp) ((RegExp1)re).content ); 173 + 174 + case sym.CCLASS: 175 + case sym.CCLASSNOT: 176 + case sym.CHAR: 177 + return false; 178 + 179 + case sym.STRING: 180 + return ((String) ((RegExp1) re).content).Length <= 0; 181 + 182 + case sym.MACROUSE: 183 + return containsEpsilon(macros.getDefinition((String) ((RegExp1) re).content)); 184 + } 185 + 186 + throw new Exception("Unkown expression type "+re.type+" in "+re); //$NON-NLS-1$ //$NON-NLS-2$ 187 + } 188 + 189 + 190 + /** 191 + * Returns the first set of an expression. 192 + * 193 + * (the first-character-projection of the language) 194 + */ 195 + private static IntCharSet first(RegExp re) { 196 + RegExp2 r; 197 + 198 + switch (re.type) { 199 + 200 + case sym.BAR: 201 + r = (RegExp2) re; 202 + return first(r.r1).add(first(r.r2)); 203 + 204 + case sym.CONCAT: 205 + r = (RegExp2) re; 206 + if ( containsEpsilon(r.r1) ) 207 + return first(r.r1).add(first(r.r2)); 208 + else 209 + return first(r.r1); 210 + 211 + case sym.STAR: 212 + case sym.PLUS: 213 + case sym.QUESTION: 214 + return first((RegExp) ((RegExp1)re).content); 215 + 216 + case sym.CCLASS: 217 + return new IntCharSet((ArrayList) ((RegExp1) re).content); 218 + 219 + case sym.CCLASSNOT: 220 + IntCharSet all = new IntCharSet(new Interval( (char) 0,maxChar)); 221 + IntCharSet set = new IntCharSet((ArrayList) ((RegExp1) re).content); 222 + all.sub(set); 223 + return all; 224 + 225 + case sym.CHAR: 226 + return new IntCharSet((char) ((RegExp1) re).content); 227 + 228 + case sym.STRING: 229 + String content = (String) ((RegExp1) re).content; 230 + if (content.Length > 0) 231 + return new IntCharSet(content[0]); 232 + else 233 + return new IntCharSet(); 234 + 235 + case sym.MACROUSE: 236 + return first(macros.getDefinition((String) ((RegExp1) re).content)); 237 + } 238 + 239 + throw new Exception("Unkown expression type "+re.type+" in "+re); //$NON-NLS-1$ //$NON-NLS-2$ 240 + } 241 + 242 + 243 + /** 244 + * Returns the last set of the expression 245 + * 246 + * (the last-charater-projection of the language) 247 + */ 248 + private static IntCharSet last(RegExp re) { 249 + 250 + RegExp2 r; 251 + 252 + switch (re.type) { 253 + 254 + case sym.BAR: 255 + r = (RegExp2) re; 256 + return last(r.r1).add(last(r.r2)); 257 + 258 + case sym.CONCAT: 259 + r = (RegExp2) re; 260 + if ( containsEpsilon(r.r2) ) 261 + return last(r.r1).add(last(r.r2)); 262 + else 263 + return last(r.r2); 264 + 265 + case sym.STAR: 266 + case sym.PLUS: 267 + case sym.QUESTION: 268 + return last((RegExp) ((RegExp1)re).content); 269 + 270 + case sym.CCLASS: 271 + return new IntCharSet((ArrayList) ((RegExp1) re).content); 272 + 273 + case sym.CCLASSNOT: 274 + IntCharSet all = new IntCharSet(new Interval( (char) 0,maxChar)); 275 + IntCharSet set = new IntCharSet((ArrayList) ((RegExp1) re).content); 276 + all.sub(set); 277 + return all; 278 + 279 + case sym.CHAR: 280 + return new IntCharSet((char)((RegExp1) re).content); 281 + 282 + case sym.STRING: 283 + String content = (String) ((RegExp1) re).content; 284 + if (content.Length > 0) 285 + return new IntCharSet(content[content.Length-1]); 286 + else 287 + return new IntCharSet(); 288 + 289 + case sym.MACROUSE: 290 + return last(macros.getDefinition((String) ((RegExp1) re).content)); 291 + } 292 + 293 + throw new Exception("Unkown expression type "+re.type+" in "+re); //$NON-NLS-1$ //$NON-NLS-2$ 294 + } 295 + } 296 + }
+202
CSFlex/Core/Skeleton.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + using System; 25 + using System.Collections; 26 + using System.IO; 27 + using System.Reflection; 28 + using System.Text; 29 + 30 + namespace CSFlex 31 + { 32 + 33 + /** 34 + * This class stores the skeleton of generated scanners. 35 + * 36 + * The skeleton consists of several parts that can be emitted to 37 + * a file. Usually there is a portion of generated code 38 + * (produced in class Emitter) between every two parts of skeleton code. 39 + * 40 + * There is a static part (the skeleton code) and state based iterator 41 + * part to this class. The iterator part is used to emit consecutive skeleton 42 + * sections to some <code>PrintWriter</code>. 43 + * 44 + * @see CSFlex.Emitter 45 + * 46 + * @author Gerwin Klein 47 + * @version JFlex 1.4, $Revision: 2.12 $, $Date: 2004/04/12 10:07:47 $ 48 + * @author Jonathan Gilbert 49 + * @version CSFlex 1.4 50 + */ 51 + public class Skeleton { 52 + /** expected number of sections in the skeleton file */ 53 + private const int size = 21; 54 + 55 + /** platform specific newline */ 56 + private static readonly String NL = Environment.NewLine; //$NON-NLS-1$ 57 + 58 + /** The skeleton */ 59 + public static String[] line; 60 + 61 + /** Whether the skeleton is C#-capable */ 62 + private static bool isCSharpSkeleton; 63 + private static bool notCSharpSkeletonWarned; 64 + 65 + // the state based, iterator part of Skeleton: 66 + 67 + /** 68 + * The current part of the skeleton (an index of nextStop[]) 69 + */ 70 + private int pos; 71 + 72 + /** 73 + * The writer to write the skeleton-parts to 74 + */ 75 + private TextWriter @out; 76 + 77 + 78 + /** 79 + * Creates a new skeleton (iterator) instance. 80 + * 81 + * @param out the writer to write the skeleton-parts to 82 + */ 83 + public Skeleton(TextWriter @out) { 84 + this.@out = @out; 85 + } 86 + 87 + 88 + /** 89 + * Emits the next part of the skeleton 90 + */ 91 + public void emitNext() { 92 + if (isCSharpSkeleton) 93 + { 94 + if (Options.emit_csharp) 95 + { 96 + pos++; 97 + @out.Write( line[pos++] ); 98 + } 99 + else 100 + { 101 + @out.Write( line[pos++] ); 102 + pos++; 103 + } 104 + } 105 + else 106 + { 107 + if (Options.emit_csharp && !notCSharpSkeletonWarned) 108 + { 109 + Out.warning(ErrorMessages.get(ErrorMessages.NOT_CSHARP_SKELETON)); 110 + notCSharpSkeletonWarned = true; 111 + } 112 + 113 + @out.Write( line[pos++] ); 114 + } 115 + } 116 + 117 + 118 + /** 119 + * Make the skeleton private. 120 + * 121 + * Replaces all occurences of " public " in the skeleton with " private ". 122 + */ 123 + public static void makePrivate() { 124 + for (int i=0; i < line.Length; i++) { 125 + line[i] = replace(" public ", " private ", line[i]); //$NON-NLS-1$ //$NON-NLS-2$ 126 + } 127 + } 128 + 129 + 130 + /** 131 + * Reads an external skeleton file from a BufferedReader. 132 + * 133 + * @param reader the reader to read from (must be != null) 134 + * @throws IOException if an IO error occurs 135 + * @throws GeneratorException if the number of skeleton sections does not match 136 + */ 137 + public static void readSkel(TextReader reader) { 138 + isCSharpSkeleton = false; 139 + notCSharpSkeletonWarned = false; 140 + 141 + ArrayList lines = new PrettyArrayList(); 142 + StringBuilder section = new StringBuilder(); 143 + 144 + String ln; 145 + while ((ln = reader.ReadLine()) != null) { 146 + if (ln.StartsWith("---")) { //$NON-NLS-1$ 147 + lines.Add(section.ToString()); 148 + section.Length = 0; 149 + } else { 150 + section.Append(ln); 151 + section.Append(NL); 152 + } 153 + } 154 + 155 + if (section.Length > 0) 156 + lines.Add(section.ToString()); 157 + 158 + if (lines.Count != size) { 159 + if (lines.Count == size * 2) 160 + isCSharpSkeleton = true; 161 + else 162 + { 163 + Out.error(ErrorMessages.WRONG_SKELETON); 164 + throw new GeneratorException(); 165 + } 166 + } 167 + 168 + line = new String[lines.Count]; 169 + for (int i = 0; i < lines.Count; i++) 170 + line[i] = (String) lines[i]; 171 + } 172 + 173 + /** 174 + * Replaces a with b in c. 175 + * 176 + * @param a the String to be replaced 177 + * @param b the replacement 178 + * @param c the String in which to replace a by b 179 + * @return a String object with a replaced by b in c 180 + */ 181 + public static String replace(String a, String b, String c) { 182 + return c.Replace(a, b); 183 + } 184 + 185 + 186 + public static void readNested() 187 + { 188 + try 189 + { 190 + Assembly assembly = typeof(Skeleton).Assembly; 191 + Stream stream = assembly.GetManifestResourceStream("csflex.skeleton.nested"); 192 + Out.println(ErrorMessages.READING_SKEL, "skeleton.nested"); 193 + readSkel(new StreamReader(stream)); 194 + } 195 + catch 196 + { 197 + Out.error(ErrorMessages.SKEL_IO_ERROR_DEFAULT); 198 + throw new GeneratorException(); 199 + } 200 + } 201 + } 202 + }
+93
CSFlex/Core/StatePairList.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + 27 + namespace CSFlex 28 + { 29 + 30 + /** 31 + * A list of pairs of states. Used in DFA minimization. 32 + * 33 + * @author Gerwin Klein 34 + * @version JFlex 1.4, $Revision: 2.3 $, $Date: 2004/04/12 10:07:47 $ 35 + * @author Jonathan Gilbert 36 + * @version CSFlex 1.4 37 + */ 38 + public sealed class StatePairList { 39 + 40 + // implemented as two arrays of integers. 41 + // java.util classes proved too inefficient. 42 + 43 + int[] p; 44 + int[] q; 45 + 46 + int num; 47 + 48 + public StatePairList() { 49 + p = new int [8]; 50 + q = new int [8]; 51 + num = 0; 52 + } 53 + 54 + public void addPair(int i, int j) { 55 + for (int x = 0; x < num; x++) 56 + if (p[x] == i && q[x] == j) return; 57 + 58 + if (num >= p.Length) increaseSize(num); 59 + 60 + p[num] = i; 61 + q[num] = j; 62 + 63 + num++; 64 + } 65 + 66 + public void markAll(StatePairList [] [] list, bool [] [] equiv) { 67 + for (int x = 0; x < num; x++) { 68 + int i = p[x]; 69 + int j = q[x]; 70 + 71 + if (equiv[i][j]) { 72 + equiv[i][j] = false; 73 + if (list[i][j] != null) 74 + list[i][j].markAll(list, equiv); 75 + } 76 + } 77 + } 78 + 79 + private void increaseSize(int length) { 80 + length = Math.Max(length+1, 4*p.Length); 81 + Out.debug("increasing length to "+length); //$NON-NLS-1$ 82 + 83 + int[] pn = new int[length]; 84 + int[] qn = new int[length]; 85 + 86 + Array.Copy(p, 0, pn, 0, p.Length); 87 + Array.Copy(q, 0, qn, 0, q.Length); 88 + 89 + p = pn; 90 + q = qn; 91 + } 92 + } 93 + }
+338
CSFlex/Core/StateSet.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + using System; 25 + using System.Text; 26 + 27 + namespace CSFlex 28 + { 29 + 30 + /** 31 + * A set of NFA states (= integers). 32 + * 33 + * Very similar to java.util.BitSet, but is faster and doesn't crash 34 + * 35 + * @author Gerwin Klein 36 + * @version JFlex 1.4, $Revision: 2.2 $, $Date: 2004/04/12 10:07:48 $ 37 + * @author Jonathan Gilbert 38 + * @version CSFlex 1.4 39 + */ 40 + public sealed class StateSet { 41 + 42 + private readonly bool DEBUG = false; 43 + 44 + public static readonly StateSet EMPTY = new StateSet(); 45 + 46 + 47 + internal const int BITS = 6; 48 + internal const int MASK = (1<<BITS)-1; 49 + 50 + internal long[] bits; 51 + 52 + 53 + public StateSet() : this(256) { 54 + } 55 + 56 + public StateSet(int size) { 57 + bits = new long[size2nbits(size)]; 58 + } 59 + 60 + public StateSet(int size, int state) : this(size) { 61 + addState(state); 62 + } 63 + 64 + public StateSet(StateSet set) { 65 + bits = new long[set.bits.Length]; 66 + Array.Copy(set.bits, 0, bits, 0, set.bits.Length); 67 + } 68 + 69 + 70 + public void addState(int state) { 71 + if (DEBUG) { 72 + Out.dump("StateSet.addState("+state+") start"); //$NON-NLS-1$ //$NON-NLS-2$ 73 + Out.dump("Set is : "+this); //$NON-NLS-1$ 74 + } 75 + 76 + int index = state >> BITS; 77 + if (index >= bits.Length) resize(state); 78 + bits[index] |= (1L << (state & MASK)); 79 + 80 + if (DEBUG) { 81 + Out.dump("StateSet.addState("+state+") end"); //$NON-NLS-1$ //$NON-NLS-2$ 82 + Out.dump("Set is : "+this); //$NON-NLS-1$ 83 + } 84 + } 85 + 86 + 87 + private int size2nbits (int size) { 88 + return ((size >> BITS) + 1); 89 + } 90 + 91 + 92 + private void resize(int size) { 93 + int needed = size2nbits(size); 94 + 95 + // if (needed < bits.length) return; 96 + 97 + long[] newbits = new long[Math.Max(bits.Length*4,needed)]; 98 + Array.Copy(bits, 0, newbits, 0, bits.Length); 99 + 100 + bits = newbits; 101 + } 102 + 103 + 104 + public void clear() { 105 + int l = bits.Length; 106 + for (int i = 0; i < l; i++) bits[i] = 0; 107 + } 108 + 109 + public bool isElement(int state) { 110 + int index = state >> BITS; 111 + if (index >= bits.Length) return false; 112 + return (bits[index] & (1L << (state & MASK))) != 0; 113 + } 114 + 115 + /** 116 + * Returns one element of the set and removes it. 117 + * 118 + * Precondition: the set is not empty. 119 + */ 120 + public int getAndRemoveElement() { 121 + int i = 0; 122 + int o = 0; 123 + long m = 1; 124 + 125 + while (bits[i] == 0) i++; 126 + 127 + while ( (bits[i] & m) == 0 ) { 128 + m<<= 1; 129 + o++; 130 + } 131 + 132 + bits[i]&= ~m; 133 + 134 + return (i << BITS) + o; 135 + } 136 + 137 + public void remove(int state) { 138 + int index = state >> BITS; 139 + if (index >= bits.Length) return; 140 + bits[index] &= ~(1L << (state & MASK)); 141 + } 142 + 143 + /** 144 + * Returns the set of elements that contained are in the specified set 145 + * but are not contained in this set. 146 + */ 147 + public StateSet complement(StateSet set) { 148 + 149 + if (set == null) return null; 150 + 151 + StateSet result = new StateSet(); 152 + 153 + result.bits = new long[set.bits.Length]; 154 + 155 + int i; 156 + int m = Math.Min(bits.Length, set.bits.Length); 157 + 158 + for (i = 0; i < m; i++) { 159 + result.bits[i] = ~bits[i] & set.bits[i]; 160 + } 161 + 162 + if (bits.Length < set.bits.Length) 163 + Array.Copy(set.bits, m, result.bits, m, result.bits.Length-m); 164 + 165 + if (DEBUG) 166 + Out.dump("Complement of "+this+Out.NL+"and "+set+Out.NL+" is :"+result); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 167 + 168 + return result; 169 + } 170 + 171 + public void add(StateSet set) { 172 + 173 + if (DEBUG) Out.dump("StateSet.add("+set+") start"); //$NON-NLS-1$ //$NON-NLS-2$ 174 + 175 + if (set == null) return; 176 + 177 + long[] tbits; 178 + long[] sbits = set.bits; 179 + int sbitsl = sbits.Length; 180 + 181 + if (bits.Length < sbitsl) { 182 + tbits = new long[sbitsl]; 183 + Array.Copy(bits, 0, tbits, 0, bits.Length); 184 + } 185 + else { 186 + tbits = this.bits; 187 + } 188 + 189 + for (int i = 0; i < sbitsl; i++) { 190 + tbits[i] |= sbits[i]; 191 + } 192 + 193 + this.bits = tbits; 194 + 195 + if (DEBUG) { 196 + Out.dump("StateSet.add("+set+") end"); //$NON-NLS-1$ //$NON-NLS-2$ 197 + Out.dump("Set is : "+this); //$NON-NLS-1$ 198 + } 199 + } 200 + 201 + 202 + 203 + public bool containsSet(StateSet set) { 204 + 205 + if (DEBUG) 206 + Out.dump("StateSet.containsSet("+set+"), this="+this); //$NON-NLS-1$ //$NON-NLS-2$ 207 + 208 + int i; 209 + int min = Math.Min(bits.Length, set.bits.Length); 210 + 211 + for (i = 0; i < min; i++) 212 + if ( (bits[i] & set.bits[i]) != set.bits[i] ) return false; 213 + 214 + for (i = min; i < set.bits.Length; i++) 215 + if ( set.bits[i] != 0 ) return false; 216 + 217 + return true; 218 + } 219 + 220 + 221 + 222 + /** 223 + * @throws ClassCastException if b is not a StateSet 224 + * @throws NullPointerException if b is null 225 + */ 226 + public override bool Equals(Object b) { 227 + 228 + int i = 0; 229 + int l1,l2; 230 + StateSet set = (StateSet) b; 231 + 232 + if (DEBUG) Out.dump("StateSet.equals("+set+"), this="+this); //$NON-NLS-1$ //$NON-NLS-2$ 233 + 234 + l1 = bits.Length; 235 + l2 = set.bits.Length; 236 + 237 + if (l1 <= l2) { 238 + while (i < l1) { 239 + if (bits[i] != set.bits[i]) return false; 240 + i++; 241 + } 242 + 243 + while (i < l2) 244 + if (set.bits[i++] != 0) return false; 245 + } 246 + else { 247 + while (i < l2) { 248 + if (bits[i] != set.bits[i]) return false; 249 + i++; 250 + } 251 + 252 + while (i < l1) 253 + if (bits[i++] != 0) return false; 254 + } 255 + 256 + return true; 257 + } 258 + 259 + public override int GetHashCode() { 260 + long h = 1234; 261 + long [] _bits = bits; 262 + int i = bits.Length-1; 263 + 264 + // ignore zero high bits 265 + while (i >= 0 && _bits[i] == 0) i--; 266 + 267 + while (i >= 0) 268 + h ^= _bits[i--] * i; 269 + 270 + return (int)((h >> 32) ^ h); 271 + } 272 + 273 + 274 + public StateSetEnumerator states() { 275 + return new StateSetEnumerator(this); 276 + } 277 + 278 + 279 + public bool containsElements() { 280 + for (int i = 0; i < bits.Length; i++) 281 + if (bits[i] != 0) return true; 282 + 283 + return false; 284 + } 285 + 286 + 287 + public StateSet copy() { 288 + StateSet set = new StateSet(); 289 + set.bits = new long[bits.Length]; 290 + Array.Copy(bits, 0, set.bits, 0, bits.Length); 291 + return set; 292 + } 293 + 294 + 295 + public void copy(StateSet set) { 296 + 297 + if (DEBUG) 298 + Out.dump("StateSet.copy("+set+") start"); //$NON-NLS-1$ //$NON-NLS-2$ 299 + 300 + if (set == null) { 301 + for (int i = 0; i < bits.Length; i++) bits[i] = 0; 302 + return; 303 + } 304 + 305 + if (bits.Length < set.bits.Length) { 306 + bits = new long[set.bits.Length]; 307 + } 308 + else { 309 + for (int i = set.bits.Length; i < bits.Length; i++) bits[i] = 0; 310 + } 311 + 312 + Array.Copy(set.bits, 0, bits, 0, bits.Length); 313 + 314 + if (DEBUG) { 315 + Out.dump("StateSet.copy("+set+") end"); //$NON-NLS-1$ //$NON-NLS-2$ 316 + Out.dump("Set is : "+this); //$NON-NLS-1$ 317 + } 318 + } 319 + 320 + 321 + public override String ToString() { 322 + StateSetEnumerator @enum = states(); 323 + 324 + StringBuilder result = new StringBuilder("{"); //$NON-NLS-1$ 325 + 326 + if ( @enum.hasMoreElements() ) result.Append(@enum.nextElement()); //$NON-NLS-1$ 327 + 328 + while ( @enum.hasMoreElements() ) { 329 + int i = @enum.nextElement(); 330 + result.Append(", ").Append(i); //$NON-NLS-1$ 331 + } 332 + 333 + result.Append("}"); //$NON-NLS-1$ 334 + 335 + return result.ToString(); 336 + } 337 + } 338 + }
+135
CSFlex/Core/StateSetEnumerator.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + namespace CSFlex 25 + { 26 + 27 + /** 28 + * Enumerates the states of a StateSet. 29 + * 30 + * @author Gerwin Klein 31 + * @version JFlex 1.4, $Revision: 2.2 $, $Date: 2004/04/12 10:07:47 $ 32 + * @author Jonathan Gilbert 33 + * @version CSFlex 1.4 34 + */ 35 + public sealed class StateSetEnumerator { 36 + 37 + private readonly bool DEBUG = false; 38 + 39 + private int index; 40 + private int offset; 41 + private long mask; 42 + 43 + //private int current; 44 + private long [] bits; 45 + 46 + /** 47 + * creates a new StateSetEnumerator that is not yet associated 48 + * with a StateSet. hasMoreElements() and nextElement() will 49 + * throw NullPointerException when used before reset() 50 + */ 51 + public StateSetEnumerator() { 52 + } 53 + 54 + public StateSetEnumerator(StateSet states) { 55 + reset(states); 56 + } 57 + 58 + public void reset(StateSet states) { 59 + bits = states.bits; 60 + index = 0; 61 + offset = 0; 62 + mask = 1; 63 + //current = 0; 64 + 65 + while (index < bits.Length && bits[index] == 0) 66 + index++; 67 + 68 + if (index >= bits.Length) return; 69 + 70 + while (offset <= StateSet.MASK && ((bits[index] & mask) == 0)) { 71 + mask<<= 1; 72 + offset++; 73 + } 74 + } 75 + 76 + private void advance() { 77 + 78 + if (DEBUG) Out.dump("Advancing, at start, index = "+index+", offset = "+offset); //$NON-NLS-1$ //$NON-NLS-2$ 79 + 80 + // cache fields in local variable for faster access 81 + int _index = this.index; 82 + int _offset = this.offset; 83 + long _mask = this.mask; 84 + long [] _bits = this.bits; 85 + 86 + long bi = _bits[_index]; 87 + 88 + do { 89 + _offset++; 90 + _mask<<= 1; 91 + } while (_offset <= StateSet.MASK && ((bi & _mask) == 0)); 92 + 93 + if (_offset > StateSet.MASK) { 94 + int length = _bits.Length; 95 + 96 + do 97 + _index++; 98 + while (_index < length && _bits[_index] == 0); 99 + 100 + if (_index >= length) { 101 + this.index = length; // indicates "no more elements" 102 + return; 103 + } 104 + 105 + _offset = 0; 106 + _mask = 1; 107 + bi = _bits[_index]; 108 + 109 + // terminates, because bi != 0 110 + while ((bi & _mask) == 0) { 111 + _mask<<= 1; 112 + _offset++; 113 + } 114 + } 115 + 116 + // write back cached values 117 + this.index = _index; 118 + this.mask = _mask; 119 + this.offset = _offset; 120 + } 121 + 122 + public bool hasMoreElements() { 123 + if (DEBUG) Out.dump("hasMoreElements, index = "+index+", offset = "+offset); //$NON-NLS-1$ //$NON-NLS-2$ 124 + return index < bits.Length; 125 + } 126 + 127 + public int nextElement() { 128 + if (DEBUG) Out.dump("nextElement, index = "+index+", offset = "+offset); //$NON-NLS-1$ //$NON-NLS-2$ 129 + int x = (index << StateSet.BITS) + offset; 130 + advance(); 131 + return x; 132 + } 133 + 134 + } 135 + }
+121
CSFlex/Core/Timer.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * Derived from: * 5 + * * 6 + * JFlex 1.4 * 7 + * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> * 8 + * All rights reserved. * 9 + * * 10 + * This program is free software; you can redistribute it and/or modify * 11 + * it under the terms of the GNU General Public License. See the file * 12 + * COPYRIGHT for more information. * 13 + * * 14 + * This program is distributed in the hope that it will be useful, * 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 + * GNU General Public License for more details. * 18 + * * 19 + * You should have received a copy of the GNU General Public License along * 20 + * with this program; if not, write to the Free Software Foundation, Inc., * 21 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 22 + * * 23 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 + 25 + using System; 26 + 27 + namespace CSFlex 28 + { 29 + 30 + /** 31 + * Very simple timer for code generation time statistics. 32 + * 33 + * Not very exact, measures user time, not processor time. 34 + * 35 + * @author Gerwin Klein 36 + * @version JFlex 1.4, $Revision: 2.2 $, $Date: 2004/04/12 10:07:47 $ 37 + * @author Jonathan Gilbert 38 + * @version CSFlex 1.4 39 + */ 40 + public class Timer { 41 + 42 + /* the timer stores start and stop time from currentTimeMillis() */ 43 + private long startTime, stopTime; 44 + 45 + /* flag if the timer is running (if stop time is valid) */ 46 + private bool running; 47 + 48 + 49 + /** 50 + * Construct a new timer that starts immediatly. 51 + */ 52 + public Timer() { 53 + startTime = java_cup.Support.currentTimeMillis(); 54 + running = true; 55 + } 56 + 57 + 58 + /** 59 + * Start the timer. If it is already running, the old start 60 + * time is lost. 61 + */ 62 + public void start() { 63 + startTime = java_cup.Support.currentTimeMillis(); 64 + running = true; 65 + } 66 + 67 + 68 + /** 69 + * Stop the timer. 70 + */ 71 + public void stop() { 72 + stopTime = java_cup.Support.currentTimeMillis(); 73 + running = false; 74 + } 75 + 76 + 77 + /** 78 + * Return the number of milliseconds the timer has been running. 79 + * 80 + * (up till now, if it still runs, up to the stop time if it has been stopped) 81 + */ 82 + public long diff() { 83 + if (running) 84 + return java_cup.Support.currentTimeMillis()-startTime; 85 + else 86 + return stopTime-startTime; 87 + } 88 + 89 + 90 + /** 91 + * Return a string representation of the timer. 92 + * 93 + * @return a string displaying the diff-time in readable format (h m s ms) 94 + * 95 + * @see Timer#diff 96 + */ 97 + public override String ToString() { 98 + long diff = this.diff(); 99 + 100 + long millis = diff%1000; 101 + long secs = (diff/1000)%60; 102 + long mins = (diff/(1000*60))%60; 103 + long hs = (diff/(1000*3600))%24; 104 + long days = diff/(1000*3600*24); 105 + 106 + if (days > 0) 107 + return days+"d "+hs+"h "+mins+"m "+secs+"s "+millis+"ms"; 108 + 109 + if (hs > 0) 110 + return hs+"h "+mins+"m "+secs+"s "+millis+"ms"; 111 + 112 + if (mins > 0) 113 + return mins+"m "+secs+"s "+millis+"ms"; 114 + 115 + if (secs > 0) 116 + return secs+"s "+millis+"ms"; 117 + 118 + return millis+"ms"; 119 + } 120 + } 121 + }
+405
CSFlex/Core/support_classes.cs
··· 1 + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 + * C# Flex 1.4 * 3 + * Copyright (C) 2004-2005 Jonathan Gilbert <logic@deltaq.org> * 4 + * All rights reserved. * 5 + * * 6 + * This program is free software; you can redistribute it and/or modify * 7 + * it under the terms of the GNU General Public License. See the file * 8 + * COPYRIGHT for more information. * 9 + * * 10 + * This program is distributed in the hope that it will be useful, * 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 + * GNU General Public License for more details. * 14 + * * 15 + * You should have received a copy of the GNU General Public License along * 16 + * with this program; if not, write to the Free Software Foundation, Inc., * 17 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 18 + * * 19 + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 20 + 21 + using System; 22 + using System.Collections; 23 + using System.IO; 24 + using System.Text; 25 + 26 + namespace CSFlex 27 + { 28 + public class RuntimeException : Exception 29 + { 30 + public RuntimeException() 31 + { 32 + } 33 + 34 + public RuntimeException(string msg) 35 + : base(msg) 36 + { 37 + } 38 + } 39 + 40 + public class File 41 + { 42 + string name; 43 + 44 + public File(string parent, string child) 45 + { 46 + name = Path.Combine(parent, child); 47 + } 48 + 49 + public File(string filename) 50 + { 51 + name = filename; 52 + } 53 + 54 + public static implicit operator string(File file) 55 + { 56 + return file.name; 57 + } 58 + 59 + public string getParent() 60 + { 61 + string ret = Path.GetDirectoryName(name); 62 + 63 + if (ret.Length == 0) 64 + return null; 65 + else 66 + return ret; 67 + } 68 + 69 + public bool exists() 70 + { 71 + FileInfo info = new FileInfo(name); 72 + 73 + return info.Exists; 74 + } 75 + 76 + public bool delete() 77 + { 78 + FileInfo info = new FileInfo(name); 79 + 80 + try 81 + { 82 + info.Delete(); 83 + return true; 84 + } 85 + catch 86 + { 87 + return false; 88 + } 89 + } 90 + 91 + public bool renameTo(File dest) 92 + { 93 + FileInfo info = new FileInfo(name); 94 + 95 + try 96 + { 97 + info.MoveTo(dest.name); 98 + return true; 99 + } 100 + catch 101 + { 102 + return false; 103 + } 104 + } 105 + 106 + public static readonly char separatorChar = Path.DirectorySeparatorChar; 107 + 108 + public bool canRead() 109 + { 110 + FileStream stream = null; 111 + 112 + try 113 + { 114 + stream = new FileStream(name, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); 115 + return true; 116 + } 117 + catch 118 + { 119 + return false; 120 + } 121 + finally 122 + { 123 + if (stream != null) 124 + stream.Close(); 125 + } 126 + } 127 + 128 + public bool isFile() 129 + { 130 + FileInfo info = new FileInfo(name); 131 + 132 + return (info.Attributes & FileAttributes.Directory) != FileAttributes.Directory; 133 + } 134 + 135 + public bool isDirectory() 136 + { 137 + FileInfo info = new FileInfo(name); 138 + 139 + return (info.Attributes & FileAttributes.Directory) == FileAttributes.Directory; 140 + } 141 + 142 + public bool mkdirs() 143 + { 144 + FileInfo info = new FileInfo(name); 145 + 146 + Stack needed = new Stack(); 147 + 148 + DirectoryInfo parent = info.Directory; 149 + 150 + try 151 + { 152 + while (!parent.Exists) 153 + { 154 + needed.Push(parent); 155 + parent = parent.Parent; 156 + } 157 + 158 + while (needed.Count > 0) 159 + { 160 + DirectoryInfo dir = (DirectoryInfo)needed.Pop(); 161 + dir.Create(); 162 + } 163 + 164 + return true; 165 + } 166 + catch 167 + { 168 + return false; 169 + } 170 + } 171 + 172 + public override string ToString() 173 + { 174 + return name; 175 + } 176 + 177 + } 178 + 179 + public class Integer 180 + { 181 + int v; 182 + 183 + public Integer(int value) 184 + { 185 + v = value; 186 + } 187 + 188 + public int intValue() 189 + { 190 + return v; 191 + } 192 + 193 + public static string toOctalString(int c) 194 + { 195 + StringBuilder ret = new StringBuilder(); 196 + 197 + while (c > 0) 198 + { 199 + int unit_place = (c & 7); 200 + c >>= 3; 201 + 202 + ret.Insert(0, (char)(unit_place + '0')); 203 + } 204 + 205 + if (ret.Length == 0) 206 + return "0"; 207 + else 208 + return ret.ToString(); 209 + } 210 + 211 + public static string toHexString(int c) 212 + { 213 + StringBuilder ret = new StringBuilder(); 214 + 215 + while (c > 0) 216 + { 217 + int unit_place = (c & 15); 218 + c >>= 4; 219 + 220 + if (unit_place >= 10) 221 + ret.Insert(0, (char)(unit_place + 'a' - 10)); 222 + else 223 + ret.Insert(0, (char)(unit_place + '0')); 224 + } 225 + 226 + if (ret.Length == 0) 227 + return "0"; 228 + else 229 + return ret.ToString(); 230 + } 231 + 232 + public static int parseInt(string s) 233 + { 234 + return parseInt(s, 10); 235 + } 236 + 237 + public static int parseInt(string s, int @base) 238 + { 239 + const string alpha = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 240 + 241 + if ((@base < 2) || (@base > 36)) 242 + throw new ArgumentException("Number base cannot be less than 2 or greater than 36", "base"); 243 + 244 + s = s.ToUpper(); 245 + 246 + int value = 0; 247 + 248 + for (int i=0; i < s.Length; i++) 249 + { 250 + int idx = alpha.IndexOf(s[i]); 251 + 252 + if ((idx < 0) || (idx >= @base)) 253 + throw new FormatException("'" + s[i] + "' is not a valid base-" + @base + " digit"); 254 + 255 + value = (value * @base) + idx; 256 + } 257 + 258 + return value; 259 + } 260 + 261 + public override int GetHashCode() 262 + { 263 + return v.GetHashCode(); 264 + } 265 + 266 + public override bool Equals(object obj) 267 + { 268 + if (obj == null) 269 + return false; 270 + 271 + if (obj is int) 272 + return (v == (int)obj); 273 + if (obj is Integer) 274 + return (v == ((Integer)obj).v); 275 + 276 + return false; 277 + } 278 + 279 + public override string ToString() 280 + { 281 + return v.ToString(); 282 + } 283 + } 284 + 285 + public class Boolean 286 + { 287 + bool v; 288 + 289 + public Boolean(bool value) 290 + { 291 + v = value; 292 + } 293 + 294 + public bool booleanValue() 295 + { 296 + return v; 297 + } 298 + } 299 + 300 + class PrettyArrayList : ArrayList 301 + { 302 + public PrettyArrayList(ICollection c) 303 + : base(c) 304 + { 305 + } 306 + 307 + public PrettyArrayList(int capacity) 308 + : base(capacity) 309 + { 310 + } 311 + 312 + public PrettyArrayList() 313 + { 314 + } 315 + 316 + public override string ToString() 317 + { 318 + StringBuilder builder = new StringBuilder(); 319 + 320 + builder.Append("["); 321 + 322 + for (int i=0; i < Count; i++) 323 + { 324 + if (i > 0) 325 + builder.Append(", "); 326 + builder.Append(this[i]); 327 + } 328 + 329 + builder.Append("]"); 330 + 331 + return builder.ToString(); 332 + } 333 + } 334 + 335 + class PrettyHashtable : Hashtable 336 + { 337 + public PrettyHashtable(IDictionary d, float loadFactor, IHashCodeProvider hcp, IComparer comparer) 338 + : base(d, loadFactor, hcp, comparer) 339 + { 340 + } 341 + 342 + public PrettyHashtable(IDictionary d, IHashCodeProvider hcp, IComparer comparer) 343 + : base(d, hcp, comparer) 344 + { 345 + } 346 + 347 + public PrettyHashtable(IDictionary d, float loadFactor) 348 + : base(d, loadFactor) 349 + { 350 + } 351 + 352 + public PrettyHashtable(IDictionary d) 353 + : base(d) 354 + { 355 + } 356 + 357 + public PrettyHashtable(int capacity, IHashCodeProvider hcp, IComparer comparer) 358 + : base(capacity, hcp, comparer) 359 + { 360 + } 361 + 362 + public PrettyHashtable(IHashCodeProvider hcp, IComparer comparer) 363 + : base(hcp, comparer) 364 + { 365 + } 366 + 367 + public PrettyHashtable(int capacity, float loadFactor, IHashCodeProvider hcp, IComparer comparer) 368 + : base(capacity, loadFactor, hcp, comparer) 369 + { 370 + } 371 + 372 + public PrettyHashtable(int capacity, float loadFactor) 373 + : base(capacity, loadFactor) 374 + { 375 + } 376 + 377 + public PrettyHashtable(int capacity) 378 + : base(capacity) 379 + { 380 + } 381 + 382 + public PrettyHashtable() 383 + { 384 + } 385 + 386 + public override string ToString() 387 + { 388 + StringBuilder builder = new StringBuilder(); 389 + 390 + builder.Append("{"); 391 + 392 + IDictionaryEnumerator enumerator = GetEnumerator(); 393 + 394 + if (enumerator.MoveNext()) 395 + builder.AppendFormat("{0}={1}", enumerator.Key, enumerator.Value); 396 + while (enumerator.MoveNext()) 397 + builder.AppendFormat(",{0}={1}", enumerator.Key, enumerator.Value); 398 + 399 + builder.Append("}"); 400 + 401 + return builder.ToString(); 402 + } 403 + 404 + } 405 + }
+62
CSFlex/Core/sym.cs
··· 1 + 2 + //---------------------------------------------------- 3 + // The following code was generated by CUP v0.10l 4 + // 23/09/2004 4:14:16 AM 5 + //---------------------------------------------------- 6 + 7 + namespace CSFlex 8 + { 9 + /** CUP generated class containing symbol constants. */ 10 + public class sym { 11 + /* terminals */ 12 + public const int DOLLAR = 5; 13 + public const int MORETHAN = 13; 14 + public const int UNICODE = 17; 15 + public const int COMMA = 11; 16 + public const int USERCODE = 30; 17 + public const int BANG = 38; 18 + public const int RBRACE = 15; 19 + public const int BAR = 35; 20 + public const int UPPERCLASS = 23; 21 + public const int REGEXPEND = 18; 22 + public const int REPEAT = 32; 23 + public const int POINT = 37; 24 + public const int OPENCLASS = 6; 25 + public const int EPILOGUE = 31; 26 + public const int EQUALS = 10; 27 + public const int DASH = 8; 28 + public const int LESSTHAN = 12; 29 + public const int LETTERCLASS = 21; 30 + public const int PLUS = 34; 31 + public const int CLOSEBRACKET = 3; 32 + public const int MACROUSE = 42; 33 + public const int CHAR = 40; 34 + public const int EOF = 0; 35 + public const int QUESTION = 36; 36 + public const int CLOSECLASS = 7; 37 + public const int FULL = 16; 38 + public const int TILDE = 39; 39 + public const int EOFRULE = 25; 40 + public const int DELIMITER = 9; 41 + public const int LBRACE = 14; 42 + public const int OPENBRACKET = 2; 43 + public const int HAT = 4; 44 + public const int STAR = 33; 45 + public const int CCLASSNOT = 44; 46 + public const int LOOKAHEAD = 27; 47 + public const int LOWERCLASS = 24; 48 + public const int ACTION = 28; 49 + public const int DIGITCLASS = 22; 50 + public const int CCLASS = 43; 51 + public const int CONCAT = 45; 52 + public const int CHAR_I = 47; 53 + public const int STRING_I = 46; 54 + public const int JLETTERCLASS = 19; 55 + public const int JLETTERDIGITCLASS = 20; 56 + public const int NOACTION = 26; 57 + public const int error = 1; 58 + public const int IDENT = 29; 59 + public const int STRING = 41; 60 + } 61 + 62 + }
+63
CSFlex/CupRuntime/Integer.cs
··· 1 + using System.Text; 2 + 3 + /* 4 + * C# CUP runtime compatibility source recovered from runtime.dll shipped by 5 + * CSFlex 1.4 and modernized in July 2026. Copyright 1996-1999 Scott Hudson, 6 + * Frank Flannery, and C. Scott Ananian. See LICENSE. 7 + */ 8 + 9 + namespace java_cup; 10 + 11 + public class Integer 12 + { 13 + private int value; 14 + 15 + public Integer(int val) 16 + { 17 + value = val; 18 + } 19 + 20 + public int intValue() 21 + { 22 + return value; 23 + } 24 + 25 + public static string toOctalString(int c) 26 + { 27 + StringBuilder stringBuilder = new StringBuilder(); 28 + while (c > 0) 29 + { 30 + int num = c & 7; 31 + c >>= 3; 32 + stringBuilder.Insert(0, (char)(num + 48)); 33 + } 34 + if (stringBuilder.Length == 0) 35 + { 36 + return "0"; 37 + } 38 + return stringBuilder.ToString(); 39 + } 40 + 41 + public static string toHexString(int c) 42 + { 43 + StringBuilder stringBuilder = new StringBuilder(); 44 + while (c > 0) 45 + { 46 + int num = c & 0xF; 47 + c >>= 4; 48 + if (num >= 10) 49 + { 50 + stringBuilder.Insert(0, (char)(num + 97 - 10)); 51 + } 52 + else 53 + { 54 + stringBuilder.Insert(0, (char)(num + 48)); 55 + } 56 + } 57 + if (stringBuilder.Length == 0) 58 + { 59 + return "0"; 60 + } 61 + return stringBuilder.ToString(); 62 + } 63 + }
+19
CSFlex/CupRuntime/LICENSE
··· 1 + CUP Parser Generator Copyright Notice, License, and Disclaimer 2 + 3 + Copyright 1996-1999 by Scott Hudson, Frank Flannery, C. Scott Ananian 4 + 5 + Permission to use, copy, modify, and distribute this software and its 6 + documentation for any purpose and without fee is hereby granted, provided 7 + that the above copyright notice appear in all copies and that both the 8 + copyright notice and this permission notice and warranty disclaimer appear 9 + in supporting documentation, and that the names of the authors or their 10 + employers not be used in advertising or publicity pertaining to distribution 11 + of the software without specific, written prior permission. 12 + 13 + The authors and their employers disclaim all warranties with regard to this 14 + software, including all implied warranties of merchantability and fitness. In 15 + no event shall the authors or their employers be liable for any special, 16 + indirect or consequential damages or any damages whatsoever resulting from 17 + loss of use, data or profits, whether in an action of contract, negligence or 18 + other tortious action, arising out of or in connection with the use or 19 + performance of this software.
+12
CSFlex/CupRuntime/Scanner.cs
··· 1 + /* 2 + * C# CUP runtime compatibility source recovered from runtime.dll shipped by 3 + * CSFlex 1.4 and modernized in July 2026. Copyright 1996-1999 Scott Hudson, 4 + * Frank Flannery, and C. Scott Ananian. See LICENSE. 5 + */ 6 + 7 + namespace java_cup.runtime; 8 + 9 + public interface Scanner 10 + { 11 + Symbol next_token(); 12 + }
+61
CSFlex/CupRuntime/Stack.cs
··· 1 + /* 2 + * C# CUP runtime compatibility source recovered from runtime.dll shipped by 3 + * CSFlex 1.4 and modernized in July 2026. Copyright 1996-1999 Scott Hudson, 4 + * Frank Flannery, and C. Scott Ananian. See LICENSE. 5 + */ 6 + 7 + using System.Collections; 8 + 9 + namespace java_cup; 10 + 11 + public class Stack 12 + { 13 + private ArrayList back = new ArrayList(); 14 + 15 + public void push(object item) 16 + { 17 + back.Add(item); 18 + } 19 + 20 + public object pop() 21 + { 22 + try 23 + { 24 + return peek(); 25 + } 26 + finally 27 + { 28 + back.RemoveAt(back.Count - 1); 29 + } 30 + } 31 + 32 + public object peek() 33 + { 34 + return back[back.Count - 1]; 35 + } 36 + 37 + public bool empty() 38 + { 39 + return back.Count == 0; 40 + } 41 + 42 + public void clear() 43 + { 44 + back.Clear(); 45 + } 46 + 47 + public int size() 48 + { 49 + return back.Count; 50 + } 51 + 52 + public object elementAt(int idx) 53 + { 54 + return back[idx]; 55 + } 56 + 57 + public void setElementAt(object new_item, int idx) 58 + { 59 + back[idx] = new_item; 60 + } 61 + }
+19
CSFlex/CupRuntime/Support.cs
··· 1 + /* 2 + * C# CUP runtime compatibility source recovered from runtime.dll shipped by 3 + * CSFlex 1.4 and modernized in July 2026. Copyright 1996-1999 Scott Hudson, 4 + * Frank Flannery, and C. Scott Ananian. See LICENSE. 5 + */ 6 + 7 + using System; 8 + 9 + namespace java_cup; 10 + 11 + public class Support 12 + { 13 + private static DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, 0); 14 + 15 + public static long currentTimeMillis() 16 + { 17 + return (long)(DateTime.Now - epoch).TotalMilliseconds; 18 + } 19 + }
+59
CSFlex/CupRuntime/Symbol.cs
··· 1 + /* 2 + * C# CUP runtime compatibility source recovered from runtime.dll shipped by 3 + * CSFlex 1.4 and modernized in July 2026. Copyright 1996-1999 Scott Hudson, 4 + * Frank Flannery, and C. Scott Ananian. See LICENSE. 5 + */ 6 + 7 + namespace java_cup.runtime; 8 + 9 + public class Symbol 10 + { 11 + public int sym; 12 + 13 + public int parse_state; 14 + 15 + internal bool used_by_parser = false; 16 + 17 + public int left; 18 + 19 + public int right; 20 + 21 + public object value; 22 + 23 + public Symbol(int id, int l, int r, object o) 24 + : this(id) 25 + { 26 + left = l; 27 + right = r; 28 + value = o; 29 + } 30 + 31 + public Symbol(int id, object o) 32 + : this(id, -1, -1, o) 33 + { 34 + } 35 + 36 + public Symbol(int id, int l, int r) 37 + : this(id, l, r, null) 38 + { 39 + } 40 + 41 + public Symbol(int sym_num) 42 + : this(sym_num, -1) 43 + { 44 + left = -1; 45 + right = -1; 46 + value = null; 47 + } 48 + 49 + internal Symbol(int sym_num, int state) 50 + { 51 + sym = sym_num; 52 + parse_state = state; 53 + } 54 + 55 + public override string ToString() 56 + { 57 + return "#" + sym; 58 + } 59 + }
+642
CSFlex/CupRuntime/lr_parser.cs
··· 1 + /* 2 + * C# CUP runtime compatibility source recovered from runtime.dll shipped by 3 + * CSFlex 1.4 and modernized in July 2026. Copyright 1996-1999 Scott Hudson, 4 + * Frank Flannery, and C. Scott Ananian. See LICENSE. 5 + */ 6 + 7 + using System; 8 + using System.Text; 9 + 10 + namespace java_cup.runtime; 11 + 12 + public abstract class lr_parser 13 + { 14 + protected const int _error_sync_size = 3; 15 + 16 + protected bool _done_parsing = false; 17 + 18 + protected int tos; 19 + 20 + protected Symbol cur_token; 21 + 22 + protected Stack stack = new Stack(); 23 + 24 + protected short[][] production_tab; 25 + 26 + protected short[][] action_tab; 27 + 28 + protected short[][] reduce_tab; 29 + 30 + private Scanner _scanner; 31 + 32 + protected Symbol[] lookahead; 33 + 34 + protected int lookahead_pos; 35 + 36 + public lr_parser() 37 + { 38 + } 39 + 40 + public lr_parser(Scanner s) 41 + : this() 42 + { 43 + setScanner(s); 44 + } 45 + 46 + protected int error_sync_size() 47 + { 48 + return 3; 49 + } 50 + 51 + public abstract short[][] production_table(); 52 + 53 + public abstract short[][] action_table(); 54 + 55 + public abstract short[][] reduce_table(); 56 + 57 + public abstract int start_state(); 58 + 59 + public abstract int start_production(); 60 + 61 + public abstract int EOF_sym(); 62 + 63 + public abstract int error_sym(); 64 + 65 + public void done_parsing() 66 + { 67 + _done_parsing = true; 68 + } 69 + 70 + public void setScanner(Scanner s) 71 + { 72 + _scanner = s; 73 + } 74 + 75 + public Scanner getScanner() 76 + { 77 + return _scanner; 78 + } 79 + 80 + public abstract Symbol do_action(int act_num, lr_parser parser, Stack stack, int top); 81 + 82 + public virtual void user_init() 83 + { 84 + } 85 + 86 + protected abstract void init_actions(); 87 + 88 + public virtual Symbol scan() 89 + { 90 + Symbol symbol = getScanner().next_token(); 91 + return (symbol != null) ? symbol : new Symbol(EOF_sym()); 92 + } 93 + 94 + public virtual void report_fatal_error(string message, object info) 95 + { 96 + done_parsing(); 97 + report_error(message, info); 98 + throw new Exception("Can't recover from previous error(s)"); 99 + } 100 + 101 + public virtual void report_error(string message, object info) 102 + { 103 + Console.Error.Write(message); 104 + if (info is Symbol) 105 + { 106 + if (((Symbol)info).left != -1) 107 + { 108 + Console.Error.WriteLine(" at character {0} of input", ((Symbol)info).left); 109 + } 110 + else 111 + { 112 + Console.Error.WriteLine(); 113 + } 114 + } 115 + else 116 + { 117 + Console.Error.WriteLine(); 118 + } 119 + } 120 + 121 + public virtual void syntax_error(Symbol cur_token) 122 + { 123 + report_error("Syntax error", cur_token); 124 + } 125 + 126 + public virtual void unrecovered_syntax_error(Symbol cur_token) 127 + { 128 + report_fatal_error("Couldn't repair and continue parse", cur_token); 129 + } 130 + 131 + protected short get_action(int state, int sym) 132 + { 133 + short[] array = action_tab[state]; 134 + if (array.Length < 20) 135 + { 136 + for (int i = 0; i < array.Length; i++) 137 + { 138 + short num = array[i++]; 139 + if (num == sym || num == -1) 140 + { 141 + return array[i]; 142 + } 143 + } 144 + return 0; 145 + } 146 + int num2 = 0; 147 + int num3 = (array.Length - 1) / 2 - 1; 148 + while (num2 <= num3) 149 + { 150 + int i = (num2 + num3) / 2; 151 + if (sym == array[i * 2]) 152 + { 153 + return array[i * 2 + 1]; 154 + } 155 + if (sym > array[i * 2]) 156 + { 157 + num2 = i + 1; 158 + } 159 + else 160 + { 161 + num3 = i - 1; 162 + } 163 + } 164 + return array[^1]; 165 + } 166 + 167 + protected short get_reduce(int state, int sym) 168 + { 169 + short[] array = reduce_tab[state]; 170 + if (array == null) 171 + { 172 + return -1; 173 + } 174 + for (int i = 0; i < array.Length; i++) 175 + { 176 + short num = array[i++]; 177 + if (num == sym || num == -1) 178 + { 179 + return array[i]; 180 + } 181 + } 182 + return -1; 183 + } 184 + 185 + public Symbol parse() 186 + { 187 + Symbol symbol = null; 188 + production_tab = production_table(); 189 + action_tab = action_table(); 190 + reduce_tab = reduce_table(); 191 + init_actions(); 192 + user_init(); 193 + cur_token = scan(); 194 + stack.clear(); 195 + stack.push(new Symbol(0, start_state())); 196 + tos = 0; 197 + _done_parsing = false; 198 + while (!_done_parsing) 199 + { 200 + if (cur_token.used_by_parser) 201 + { 202 + throw new Exception("Symbol recycling detected (fix your scanner)."); 203 + } 204 + int num = get_action(((Symbol)stack.peek()).parse_state, cur_token.sym); 205 + if (num > 0) 206 + { 207 + cur_token.parse_state = num - 1; 208 + cur_token.used_by_parser = true; 209 + stack.push(cur_token); 210 + tos++; 211 + cur_token = scan(); 212 + } 213 + else if (num < 0) 214 + { 215 + symbol = do_action(-num - 1, this, stack, tos); 216 + short sym = production_tab[-num - 1][0]; 217 + short num2 = production_tab[-num - 1][1]; 218 + for (int i = 0; i < num2; i++) 219 + { 220 + stack.pop(); 221 + tos--; 222 + } 223 + num = get_reduce(((Symbol)stack.peek()).parse_state, sym); 224 + symbol.parse_state = num; 225 + symbol.used_by_parser = true; 226 + stack.push(symbol); 227 + tos++; 228 + } 229 + else if (num == 0) 230 + { 231 + syntax_error(cur_token); 232 + if (!error_recovery(debug: false)) 233 + { 234 + unrecovered_syntax_error(cur_token); 235 + done_parsing(); 236 + } 237 + else 238 + { 239 + symbol = (Symbol)stack.peek(); 240 + } 241 + } 242 + } 243 + return symbol; 244 + } 245 + 246 + public virtual void debug_message(string mess) 247 + { 248 + Console.Error.WriteLine(mess); 249 + } 250 + 251 + public virtual void dump_stack() 252 + { 253 + if (stack == null) 254 + { 255 + debug_message("# Stack dump requested, but stack is null"); 256 + return; 257 + } 258 + debug_message("============ Parse Stack Dump ============"); 259 + for (int i = 0; i < stack.size(); i++) 260 + { 261 + debug_message("Symbol: " + ((Symbol)stack.elementAt(i)).sym + " State: " + ((Symbol)stack.elementAt(i)).parse_state); 262 + } 263 + debug_message("=========================================="); 264 + } 265 + 266 + public virtual void debug_reduce(int prod_num, int nt_num, int rhs_size) 267 + { 268 + debug_message("# Reduce with prod #" + prod_num + " [NT=" + nt_num + ", SZ=" + rhs_size + "]"); 269 + } 270 + 271 + public virtual void debug_shift(Symbol shift_tkn) 272 + { 273 + debug_message("# Shift under term #" + shift_tkn.sym + " to state #" + shift_tkn.parse_state); 274 + } 275 + 276 + public virtual void debug_stack() 277 + { 278 + StringBuilder stringBuilder = new StringBuilder("## STACK:"); 279 + for (int i = 0; i < stack.size(); i++) 280 + { 281 + Symbol symbol = (Symbol)stack.elementAt(i); 282 + stringBuilder.AppendFormat(" <state {0}, sym {1}>", symbol.parse_state, symbol.sym); 283 + if (i % 3 == 2 || i == stack.size() - 1) 284 + { 285 + debug_message(stringBuilder.ToString()); 286 + stringBuilder = new StringBuilder(" "); 287 + } 288 + } 289 + } 290 + 291 + public Symbol debug_parse() 292 + { 293 + Symbol symbol = null; 294 + production_tab = production_table(); 295 + action_tab = action_table(); 296 + reduce_tab = reduce_table(); 297 + debug_message("# Initializing parser"); 298 + init_actions(); 299 + user_init(); 300 + cur_token = scan(); 301 + debug_message("# Current Symbol is #" + cur_token.sym); 302 + stack.clear(); 303 + stack.push(new Symbol(0, start_state())); 304 + tos = 0; 305 + _done_parsing = false; 306 + while (!_done_parsing) 307 + { 308 + if (cur_token.used_by_parser) 309 + { 310 + throw new Exception("Symbol recycling detected (fix your scanner)."); 311 + } 312 + int num = get_action(((Symbol)stack.peek()).parse_state, cur_token.sym); 313 + if (num > 0) 314 + { 315 + cur_token.parse_state = num - 1; 316 + cur_token.used_by_parser = true; 317 + debug_shift(cur_token); 318 + stack.push(cur_token); 319 + tos++; 320 + cur_token = scan(); 321 + debug_message("# Current token is " + cur_token); 322 + } 323 + else if (num < 0) 324 + { 325 + symbol = do_action(-num - 1, this, stack, tos); 326 + short num2 = production_tab[-num - 1][0]; 327 + short num3 = production_tab[-num - 1][1]; 328 + debug_reduce(-num - 1, num2, num3); 329 + for (int i = 0; i < num3; i++) 330 + { 331 + stack.pop(); 332 + tos--; 333 + } 334 + num = get_reduce(((Symbol)stack.peek()).parse_state, num2); 335 + debug_message("# Reduce rule: top state " + ((Symbol)stack.peek()).parse_state + ", lhs sym " + num2 + " -> state " + num); 336 + symbol.parse_state = num; 337 + symbol.used_by_parser = true; 338 + stack.push(symbol); 339 + tos++; 340 + debug_message("# Goto state #" + num); 341 + } 342 + else if (num == 0) 343 + { 344 + syntax_error(cur_token); 345 + if (!error_recovery(debug: true)) 346 + { 347 + unrecovered_syntax_error(cur_token); 348 + done_parsing(); 349 + } 350 + else 351 + { 352 + symbol = (Symbol)stack.peek(); 353 + } 354 + } 355 + } 356 + return symbol; 357 + } 358 + 359 + protected bool error_recovery(bool debug) 360 + { 361 + if (debug) 362 + { 363 + debug_message("# Attempting error recovery"); 364 + } 365 + if (!find_recovery_config(debug)) 366 + { 367 + if (debug) 368 + { 369 + debug_message("# Error recovery fails"); 370 + } 371 + return false; 372 + } 373 + read_lookahead(); 374 + while (true) 375 + { 376 + if (debug) 377 + { 378 + debug_message("# Trying to parse ahead"); 379 + } 380 + if (try_parse_ahead(debug)) 381 + { 382 + break; 383 + } 384 + if (lookahead[0].sym == EOF_sym()) 385 + { 386 + if (debug) 387 + { 388 + debug_message("# Error recovery fails at EOF"); 389 + } 390 + return false; 391 + } 392 + if (debug) 393 + { 394 + debug_message("# Consuming Symbol #" + lookahead[0].sym); 395 + } 396 + restart_lookahead(); 397 + } 398 + if (debug) 399 + { 400 + debug_message("# Parse-ahead ok, going back to normal parse"); 401 + } 402 + parse_lookahead(debug); 403 + return true; 404 + } 405 + 406 + protected bool shift_under_error() 407 + { 408 + return get_action(((Symbol)stack.peek()).parse_state, error_sym()) > 0; 409 + } 410 + 411 + protected bool find_recovery_config(bool debug) 412 + { 413 + if (debug) 414 + { 415 + debug_message("# Finding recovery state on stack"); 416 + } 417 + int right = ((Symbol)stack.peek()).right; 418 + int left = ((Symbol)stack.peek()).left; 419 + while (!shift_under_error()) 420 + { 421 + if (debug) 422 + { 423 + debug_message("# Pop stack by one, state was # " + ((Symbol)stack.peek()).parse_state); 424 + } 425 + left = ((Symbol)stack.pop()).left; 426 + tos--; 427 + if (stack.empty()) 428 + { 429 + if (debug) 430 + { 431 + debug_message("# No recovery state found on stack"); 432 + } 433 + return false; 434 + } 435 + } 436 + int num = get_action(((Symbol)stack.peek()).parse_state, error_sym()); 437 + if (debug) 438 + { 439 + debug_message("# Recover state found (#" + ((Symbol)stack.peek()).parse_state + ")"); 440 + debug_message("# Shifting on error to state #" + (num - 1)); 441 + } 442 + Symbol symbol = new Symbol(error_sym(), left, right); 443 + symbol.parse_state = num - 1; 444 + symbol.used_by_parser = true; 445 + stack.push(symbol); 446 + tos++; 447 + return true; 448 + } 449 + 450 + protected void read_lookahead() 451 + { 452 + lookahead = new Symbol[error_sync_size()]; 453 + for (int i = 0; i < error_sync_size(); i++) 454 + { 455 + lookahead[i] = cur_token; 456 + cur_token = scan(); 457 + } 458 + lookahead_pos = 0; 459 + } 460 + 461 + protected Symbol cur_err_token() 462 + { 463 + return lookahead[lookahead_pos]; 464 + } 465 + 466 + protected bool advance_lookahead() 467 + { 468 + lookahead_pos++; 469 + return lookahead_pos < error_sync_size(); 470 + } 471 + 472 + protected void restart_lookahead() 473 + { 474 + for (int i = 1; i < error_sync_size(); i++) 475 + { 476 + lookahead[i - 1] = lookahead[i]; 477 + } 478 + lookahead[error_sync_size() - 1] = cur_token; 479 + cur_token = scan(); 480 + lookahead_pos = 0; 481 + } 482 + 483 + protected bool try_parse_ahead(bool debug) 484 + { 485 + virtual_parse_stack virtual_parse_stack2 = new virtual_parse_stack(stack); 486 + while (true) 487 + { 488 + int num = get_action(virtual_parse_stack2.top(), cur_err_token().sym); 489 + if (num == 0) 490 + { 491 + return false; 492 + } 493 + if (num > 0) 494 + { 495 + virtual_parse_stack2.push(num - 1); 496 + if (debug) 497 + { 498 + debug_message("# Parse-ahead shifts Symbol #" + cur_err_token().sym + " into state #" + (num - 1)); 499 + } 500 + if (!advance_lookahead()) 501 + { 502 + return true; 503 + } 504 + continue; 505 + } 506 + if (-num - 1 == start_production()) 507 + { 508 + break; 509 + } 510 + short num2 = production_tab[-num - 1][0]; 511 + short num3 = production_tab[-num - 1][1]; 512 + for (int i = 0; i < num3; i++) 513 + { 514 + virtual_parse_stack2.pop(); 515 + } 516 + if (debug) 517 + { 518 + debug_message("# Parse-ahead reduces: handle size = " + num3 + " lhs = #" + num2 + " from state #" + virtual_parse_stack2.top()); 519 + } 520 + virtual_parse_stack2.push(get_reduce(virtual_parse_stack2.top(), num2)); 521 + if (debug) 522 + { 523 + debug_message("# Goto state #" + virtual_parse_stack2.top()); 524 + } 525 + } 526 + if (debug) 527 + { 528 + debug_message("# Parse-ahead accepts"); 529 + } 530 + return true; 531 + } 532 + 533 + protected void parse_lookahead(bool debug) 534 + { 535 + Symbol symbol = null; 536 + lookahead_pos = 0; 537 + if (debug) 538 + { 539 + debug_message("# Reparsing saved input with actions"); 540 + debug_message("# Current Symbol is #" + cur_err_token().sym); 541 + debug_message("# Current state is #" + ((Symbol)stack.peek()).parse_state); 542 + } 543 + while (!_done_parsing) 544 + { 545 + int num = get_action(((Symbol)stack.peek()).parse_state, cur_err_token().sym); 546 + if (num > 0) 547 + { 548 + cur_err_token().parse_state = num - 1; 549 + cur_err_token().used_by_parser = true; 550 + if (debug) 551 + { 552 + debug_shift(cur_err_token()); 553 + } 554 + stack.push(cur_err_token()); 555 + tos++; 556 + if (!advance_lookahead()) 557 + { 558 + if (debug) 559 + { 560 + debug_message("# Completed reparse"); 561 + } 562 + break; 563 + } 564 + if (debug) 565 + { 566 + debug_message("# Current Symbol is #" + cur_err_token().sym); 567 + } 568 + } 569 + else if (num < 0) 570 + { 571 + symbol = do_action(-num - 1, this, stack, tos); 572 + short num2 = production_tab[-num - 1][0]; 573 + short num3 = production_tab[-num - 1][1]; 574 + if (debug) 575 + { 576 + debug_reduce(-num - 1, num2, num3); 577 + } 578 + for (int i = 0; i < num3; i++) 579 + { 580 + stack.pop(); 581 + tos--; 582 + } 583 + num = (symbol.parse_state = get_reduce(((Symbol)stack.peek()).parse_state, num2)); 584 + symbol.used_by_parser = true; 585 + stack.push(symbol); 586 + tos++; 587 + if (debug) 588 + { 589 + debug_message("# Goto state #" + num); 590 + } 591 + } 592 + else if (num == 0) 593 + { 594 + report_fatal_error("Syntax error", symbol); 595 + break; 596 + } 597 + } 598 + } 599 + 600 + protected static short[][] unpackFromStrings(string[] sa) 601 + { 602 + StringBuilder stringBuilder = new StringBuilder(sa[0]); 603 + for (int i = 1; i < sa.Length; i++) 604 + { 605 + stringBuilder.Append(sa[i]); 606 + } 607 + int num = 0; 608 + int num2 = (int)(((uint)stringBuilder[num] << 16) | stringBuilder[num + 1]); 609 + num += 2; 610 + short[][] array = new short[num2][]; 611 + for (int j = 0; j < num2; j++) 612 + { 613 + int num3 = (int)(((uint)stringBuilder[num] << 16) | stringBuilder[num + 1]); 614 + num += 2; 615 + array[j] = new short[num3]; 616 + for (int k = 0; k < num3; k++) 617 + { 618 + array[j][k] = (short)(stringBuilder[num++] - 2); 619 + } 620 + } 621 + return array; 622 + } 623 + 624 + protected static short[][] unpackFromShorts(short[] sb) 625 + { 626 + int num = 0; 627 + int num2 = (sb[num] << 16) | (ushort)sb[num + 1]; 628 + num += 2; 629 + short[][] array = new short[num2][]; 630 + for (int i = 0; i < num2; i++) 631 + { 632 + int num3 = (sb[num] << 16) | (ushort)sb[num + 1]; 633 + num += 2; 634 + array[i] = new short[num3]; 635 + for (int j = 0; j < num3; j++) 636 + { 637 + array[i][j] = (short)(sb[num++] - 2); 638 + } 639 + } 640 + return array; 641 + } 642 + }
+72
CSFlex/CupRuntime/virtual_parse_stack.cs
··· 1 + /* 2 + * C# CUP runtime compatibility source recovered from runtime.dll shipped by 3 + * CSFlex 1.4 and modernized in July 2026. Copyright 1996-1999 Scott Hudson, 4 + * Frank Flannery, and C. Scott Ananian. See LICENSE. 5 + */ 6 + 7 + using System; 8 + 9 + namespace java_cup.runtime; 10 + 11 + public class virtual_parse_stack 12 + { 13 + protected Stack real_stack; 14 + 15 + protected int real_next; 16 + 17 + protected Stack vstack; 18 + 19 + public virtual_parse_stack(Stack shadowing_stack) 20 + { 21 + if (shadowing_stack == null) 22 + { 23 + throw new Exception("Internal parser error: attempt to create null virtual stack"); 24 + } 25 + real_stack = shadowing_stack; 26 + vstack = new Stack(); 27 + real_next = 0; 28 + get_from_real(); 29 + } 30 + 31 + protected void get_from_real() 32 + { 33 + if (real_next < real_stack.size()) 34 + { 35 + Symbol symbol = (Symbol)real_stack.elementAt(real_stack.size() - 1 - real_next); 36 + real_next++; 37 + vstack.push(symbol.parse_state); 38 + } 39 + } 40 + 41 + public bool empty() 42 + { 43 + return vstack.empty(); 44 + } 45 + 46 + public int top() 47 + { 48 + if (empty()) 49 + { 50 + throw new Exception("Internal parser error: top() called on empty virtual stack"); 51 + } 52 + return (int)vstack.peek(); 53 + } 54 + 55 + public void pop() 56 + { 57 + if (empty()) 58 + { 59 + throw new Exception("Internal parser error: pop from empty virtual stack"); 60 + } 61 + vstack.pop(); 62 + if (empty()) 63 + { 64 + get_from_real(); 65 + } 66 + } 67 + 68 + public void push(int state_num) 69 + { 70 + vstack.push(state_num); 71 + } 72 + }
+27
CSFlex/PROVENANCE.md
··· 1 + # CSFlex source generator provenance 2 + 3 + This component is a modern .NET port of C# Flex 1.4, retrieved from the 4 + authoritative SourceForge Subversion repository at revision 4: 5 + 6 + https://svn.code.sf.net/p/csflex/code/trunk/ 7 + 8 + The scanner-generation core, generated specification scanner/parser, message 9 + catalogue, and skeleton resources retain their upstream copyright notices. 10 + The WinForms GUI and command-line front end were deliberately omitted. The 11 + remaining core was adapted in July 2026 to run in memory and to expose a 12 + Roslyn incremental source generator over `AdditionalFiles`. 13 + 14 + C# Flex depends on the C# CUP runtime that upstream distributed as 15 + `runtime.dll`. The compatibility sources in `CupRuntime/` were recovered from 16 + that exact upstream binary and checked against the historical CUP.net source 17 + archive `CUP-parser-generator-2003-12-06-19-53.zip` distributed by the 18 + SourceForge `datagraph` project. They are included solely to support C# Flex's 19 + upstream-generated grammar parser and retain the GPL-compatible CUP license in 20 + `CupRuntime/LICENSE`. 21 + 22 + The CSFlex port and its source-generator wrapper are distributed under 23 + the terms in `COPYRIGHT` (GNU GPL version 2). As stated by upstream, code 24 + generated by C# Flex inherits the copyright of its input specification; an 25 + author-owned specification may therefore produce code used without 26 + restriction. Generated Prexonite lexer code remains covered by the Prexonite 27 + project's license, not by the generator's GPL.
+255
CSFlex/Resources/Messages.xml
··· 1 + <?xml version="1.0" encoding="utf-8" ?> 2 + <root> 3 + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> 4 + <xsd:element name="root" msdata:IsDataSet="true"> 5 + <xsd:complexType> 6 + <xsd:choice maxOccurs="unbounded"> 7 + <xsd:element name="data"> 8 + <xsd:complexType> 9 + <xsd:sequence> 10 + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> 11 + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> 12 + </xsd:sequence> 13 + <xsd:attribute name="name" type="xsd:string" /> 14 + <xsd:attribute name="type" type="xsd:string" /> 15 + <xsd:attribute name="mimetype" type="xsd:string" /> 16 + </xsd:complexType> 17 + </xsd:element> 18 + <xsd:element name="resheader"> 19 + <xsd:complexType> 20 + <xsd:sequence> 21 + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> 22 + </xsd:sequence> 23 + <xsd:attribute name="name" type="xsd:string" use="required" /> 24 + </xsd:complexType> 25 + </xsd:element> 26 + </xsd:choice> 27 + </xsd:complexType> 28 + </xsd:element> 29 + </xsd:schema> 30 + <resheader name="ResMimeType"> 31 + <value>text/microsoft-resx</value> 32 + </resheader> 33 + <resheader name="Version"> 34 + <value>1.0.0.0</value> 35 + </resheader> 36 + <resheader name="Reader"> 37 + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 38 + </resheader> 39 + <resheader name="Writer"> 40 + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 41 + </resheader> 42 + <data name="UNTERMINATED_STR"> 43 + <value>Unterminated string at end of line.</value> 44 + </data> 45 + <data name="EOF_WO_ACTION"> 46 + <value>&lt;&lt;EOF&gt;&gt; must be followed by an action.</value> 47 + </data> 48 + <data name="EOF_SINGLERULE"> 49 + <value>&lt;&lt;EOF&gt;&gt; can only be used as a single rule.</value> 50 + </data> 51 + <data name="UNKNOWN_OPTION"> 52 + <value>Unkown %-option</value> 53 + </data> 54 + <data name="UNEXPECTED_CHAR"> 55 + <value>Unexpected character </value> 56 + </data> 57 + <data name="UNEXPECTED_NL"> 58 + <value>Unexpected character &lt;newline&gt;</value> 59 + </data> 60 + <data name="LEXSTATE_UNDECL"> 61 + <value>Lexical state has not been declared.</value> 62 + </data> 63 + <data name="STATE_IDENT_EXP"> 64 + <value>State identifier expected.</value> 65 + </data> 66 + <data name="REPEAT_ZERO"> 67 + <value>Illegal repeat statement. At least one operand must be &gt; 0</value> 68 + </data> 69 + <data name="REPEAT_GREATER"> 70 + <value>Illegal repeat statement. First operand must not be greater than second one.</value> 71 + </data> 72 + <data name="REGEXP_EXPECTED"> 73 + <value>Regular expression expected.</value> 74 + </data> 75 + <data name="MACRO_UNDECL"> 76 + <value>Macro has not been declared.</value> 77 + </data> 78 + <data name="CHARSET_2_SMALL"> 79 + <value>Character set is too small for this class.</value> 80 + </data> 81 + <data name="CS2SMALL_STRING"> 82 + <value>Character set is too small for a charactor of this string.</value> 83 + </data> 84 + <data name="CS2SMALL_CHAR"> 85 + <value>Character set is too small for this character.</value> 86 + </data> 87 + <data name="CHARCLASS_MACRO"> 88 + <value>Macros in character classes are not supported.</value> 89 + </data> 90 + <data name="UNKNOWN_SYNTAX"> 91 + <value>Syntax error.</value> 92 + </data> 93 + <data name="SYNTAX_ERROR"> 94 + <value>Syntax error.</value> 95 + </data> 96 + <data name="NOT_AT_BOL"> 97 + <value>%-option is not at the beginning of the line.</value> 98 + </data> 99 + <data name="NO_MATCHING_BR"> 100 + <value>Didn't find matching bracket</value> 101 + </data> 102 + <data name="EOF_IN_ACTION"> 103 + <value>Unexpected end of file in action code</value> 104 + </data> 105 + <data name="EOF_IN_COMMENT"> 106 + <value>Unexpected end of file in comment</value> 107 + </data> 108 + <data name="EOF_IN_STRING"> 109 + <value>Unexpected end of file in string</value> 110 + </data> 111 + <data name="EOF_IN_MACROS"> 112 + <value>Unexpected end of file in macros</value> 113 + </data> 114 + <data name="EOF_IN_STATES"> 115 + <value>Unexpected end of file in state list</value> 116 + </data> 117 + <data name="EOF_IN_REGEXP"> 118 + <value>Unexpected end of file in regular expression</value> 119 + </data> 120 + <data name="UNEXPECTED_EOF"> 121 + <value>Unexpected end of file (maybe missing "*/" ")" "]" or "}")</value> 122 + </data> 123 + <data name="NO_LEX_SPEC"> 124 + <value>This seems not to be a lexical specification (first %% is missing)</value> 125 + </data> 126 + <data name="NO_LAST_ACTION"> 127 + <value>Last action in the specification must not be "|"</value> 128 + </data> 129 + <data name="LOOKAHEAD_ERROR"> 130 + <value>End of expression matches beginning of trailing context</value> 131 + </data> 132 + <data name="NO_DIRECTORY"> 133 + <value>No directory for -d option</value> 134 + </data> 135 + <data name="NO_SKEL_FILE"> 136 + <value>No file provided for -skel option</value> 137 + </data> 138 + <data name="WRONG_SKELETON"> 139 + <value>Incorrect skeleton file (wrong number of sections).</value> 140 + </data> 141 + <data name="OUT_OF_MEMORY"> 142 + <value>C# Flex has run out of memory.</value> 143 + </data> 144 + <data name="QUIL_INITTHROW"> 145 + <value>%initthrow needs a list of (qualified) identifiers</value> 146 + </data> 147 + <data name="QUIL_EOFTHROW"> 148 + <value>%eofthrow needs a list of (qualified) identifiers</value> 149 + </data> 150 + <data name="QUIL_YYLEXTHROW"> 151 + <value>%yylexthrow needs a list of (qualified) identifiers</value> 152 + </data> 153 + <data name="ZERO_STATES"> 154 + <value>Your scanner has zero states. Very funny.</value> 155 + </data> 156 + <data name="NO_BUFFER_SIZE"> 157 + <value>%buffer expects the size of the scanner buffer as decimal number</value> 158 + </data> 159 + <data name="NOT_READABLE"> 160 + <value>Could not open file.</value> 161 + </data> 162 + <data name="FILE_CYCLE"> 163 + <value>Cyclic file inclusion.</value> 164 + </data> 165 + <data name="FILE_WRITE"> 166 + <value>Error writing to file</value> 167 + </data> 168 + <data name="QUIL_SCANERROR"> 169 + <value>%scannerror needs a (qualified) identifier</value> 170 + </data> 171 + <data name="NEVER_MATCH"> 172 + <value>Rule can never be matched:</value> 173 + </data> 174 + <data name="QUIL_THROW"> 175 + <value>%throws needs a list of (qualified) identifiers</value> 176 + </data> 177 + <data name="EOL_IN_CHARCLASS"> 178 + <value>Unexpected newline in character class (closing "]" is missing)</value> 179 + </data> 180 + <data name="QUIL_CUPSYM"> 181 + <value>%cupsym needs a (qualified) identifier</value> 182 + </data> 183 + <data name="CUPSYM_AFTER_CUP"> 184 + <value>%cupsym should be used before %cup</value> 185 + </data> 186 + <data name="ALREADY_RUNNING"> 187 + <value>The generator is already running</value> 188 + </data> 189 + <data name="CANNOT_READ_SKEL"> 190 + <value>Cannot read skeleton file "{0}".</value> 191 + </data> 192 + <data name="READING_SKEL"> 193 + <value>Reading skeleton file "{0}".</value> 194 + </data> 195 + <data name="SKEL_IO_ERROR"> 196 + <value>IO problem reading skeleton file.</value> 197 + </data> 198 + <data name="SKEL_IO_ERROR_DEFAULT"> 199 + <value>IO problem reading default skeleton file.</value> 200 + </data> 201 + <data name="READING"> 202 + <value>Reading "{0}"</value> 203 + </data> 204 + <data name="CANNOT_OPEN"> 205 + <value>Sorry, couldn''t find the file "{0}".</value> 206 + </data> 207 + <data name="NFA_IS"> 208 + <value>NFA is</value> 209 + </data> 210 + <data name="NFA_STATES"> 211 + <value>{0} states in NFA</value> 212 + </data> 213 + <data name="DFA_TOOK"> 214 + <value>DFA construction took {0}</value> 215 + </data> 216 + <data name="DFA_IS"> 217 + <value>DFA is</value> 218 + </data> 219 + <data name="MIN_TOOK"> 220 + <value>Minimization took {0} </value> 221 + </data> 222 + <data name="MIN_DFA_IS"> 223 + <value>Miniminal DFA is</value> 224 + </data> 225 + <data name="WRITE_TOOK"> 226 + <value>Writing took {0}</value> 227 + </data> 228 + <data name="TOTAL_TIME"> 229 + <value>Overall scanner generation time: {0}</value> 230 + </data> 231 + <data name="IO_ERROR"> 232 + <value>An I/O-Error occured: {0}</value> 233 + </data> 234 + <data name="THIS_IS_CSFLEX"> 235 + <value>This is C# Flex {0}</value> 236 + </data> 237 + <data name="UNKNOWN_COMMANDLINE"> 238 + <value>Error: unknown option "{0}".</value> 239 + </data> 240 + <data name="MACRO_CYCLE"> 241 + <value>Macro {0} contains a cycle.</value> 242 + </data> 243 + <data name="MACRO_DEF_MISSING"> 244 + <value>Found no definition for '{{0}'} while expanding '{{1}'}</value> 245 + </data> 246 + <data name="PARSING_TOOK"> 247 + <value>Parsing took {0}</value> 248 + </data> 249 + <data name="NFA_TOOK"> 250 + <value>NFA construction took {0}</value> 251 + </data> 252 + <data name="NOT_CSHARP_SKELETON"> 253 + <value>Skeleton file is not C#-compatible</value> 254 + </data> 255 + </root>
+842
CSFlex/Resources/skeleton.nested
··· 1 + 2 + /** This character denotes the end of file */ 3 + public static final int YYEOF = -1; 4 + 5 + /** initial size of the lookahead buffer */ 6 + --- C# version 7 + 8 + /** This character denotes the end of file */ 9 + public const int YYEOF = -1; 10 + 11 + /** initial size of the lookahead buffer */ 12 + --- private static final int ZZ_BUFFERSIZE = ...; 13 + 14 + /** lexical states */ 15 + --- C# version (identical in this case) 16 + 17 + /** lexical states */ 18 + --- lexical states, charmap 19 + 20 + /* error codes */ 21 + private static final int ZZ_UNKNOWN_ERROR = 0; 22 + private static final int ZZ_NO_MATCH = 1; 23 + private static final int ZZ_PUSHBACK_2BIG = 2; 24 + 25 + /* error messages for the codes above */ 26 + private static final String ZZ_ERROR_MSG[] = { 27 + "Unkown internal scanner error", 28 + "Error: could not match input", 29 + "Error: pushback value was too large" 30 + }; 31 + 32 + --- C# version 33 + 34 + /* error codes */ 35 + private const int ZZ_UNKNOWN_ERROR = 0; 36 + private const int ZZ_NO_MATCH = 1; 37 + private const int ZZ_PUSHBACK_2BIG = 2; 38 + 39 + /* error messages for the codes above */ 40 + private static readonly String[] ZZ_ERROR_MSG = new string[] { 41 + "Unkown internal scanner error", 42 + "Error: could not match input", 43 + "Error: pushback value was too large" 44 + }; 45 + 46 + --- isFinal list 47 + /** the input device */ 48 + private java.io.Reader zzReader; 49 + 50 + /** the current state of the DFA */ 51 + private int zzState; 52 + 53 + /** the current lexical state */ 54 + private int zzLexicalState = YYINITIAL; 55 + 56 + /** this buffer contains the current text to be matched and is 57 + the source of the yytext() string */ 58 + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; 59 + 60 + /** the textposition at the last accepting state */ 61 + private int zzMarkedPos; 62 + 63 + /** the textposition at the last state to be included in yytext */ 64 + private int zzPushbackPos; 65 + 66 + /** the current text position in the buffer */ 67 + private int zzCurrentPos; 68 + 69 + /** startRead marks the beginning of the yytext() string in the buffer */ 70 + private int zzStartRead; 71 + 72 + /** endRead marks the last character in the buffer, that has been read 73 + from input */ 74 + private int zzEndRead; 75 + 76 + /** number of newlines encountered up to the start of the matched text */ 77 + private int yyline; 78 + 79 + /** the number of characters up to the start of the matched text */ 80 + private int yychar; 81 + 82 + /** 83 + * the number of characters from the last newline up to the start of the 84 + * matched text 85 + */ 86 + private int yycolumn; 87 + 88 + /** 89 + * zzAtBOL == true <=> the scanner is currently at the beginning of a line 90 + */ 91 + private boolean zzAtBOL = true; 92 + 93 + /** zzAtEOF == true <=> the scanner is at the EOF */ 94 + private boolean zzAtEOF; 95 + 96 + 97 + /** the stack of open (nested) input streams to read from */ 98 + private java.util.Stack zzStreams = new java.util.Stack(); 99 + 100 + /** 101 + * inner class used to store info for nested 102 + * input streams 103 + */ 104 + private static final class ZzFlexStreamInfo { 105 + java.io.Reader zzReader; 106 + int zzEndRead; 107 + int zzStartRead; 108 + int zzCurrentPos; 109 + int zzMarkedPos; 110 + int zzPushbackPos; 111 + int yyline; 112 + int yycolumn; 113 + char [] zzBuffer; 114 + boolean zzAtEOF; 115 + 116 + /** sets all values stored in this class */ 117 + ZzFlexStreamInfo(java.io.Reader zzReader, int zzEndRead, int zzStartRead, 118 + int zzCurrentPos, int zzMarkedPos, int zzPushbackPos, 119 + char [] zzBuffer, boolean zzAtEOF, int yyline, int yycolumn) { 120 + this.zzReader = zzReader; 121 + this.zzEndRead = zzEndRead; 122 + this.zzStartRead = zzStartRead; 123 + this.zzCurrentPos = zzCurrentPos; 124 + this.zzMarkedPos = zzMarkedPos; 125 + this.zzPushbackPos = zzPushbackPos; 126 + this.zzBuffer = zzBuffer; 127 + this.zzAtEOF = zzAtEOF; 128 + this.yyline = yyline; 129 + this.yycolumn = yycolumn; 130 + } 131 + } 132 + 133 + --- C# version 134 + /** the input device */ 135 + private System.IO.TextReader zzReader; 136 + 137 + /** the current state of the DFA */ 138 + private int zzState; 139 + 140 + /** the current lexical state */ 141 + private int zzLexicalState = YYINITIAL; 142 + 143 + /** this buffer contains the current text to be matched and is 144 + the source of the yytext() string */ 145 + private char[] zzBuffer = new char[ZZ_BUFFERSIZE]; 146 + 147 + /** the textposition at the last accepting state */ 148 + private int zzMarkedPos; 149 + 150 + /** the textposition at the last state to be included in yytext */ 151 + private int zzPushbackPos; 152 + 153 + /** the current text position in the buffer */ 154 + private int zzCurrentPos; 155 + 156 + /** startRead marks the beginning of the yytext() string in the buffer */ 157 + private int zzStartRead; 158 + 159 + /** endRead marks the last character in the buffer, that has been read 160 + from input */ 161 + private int zzEndRead; 162 + 163 + /** number of newlines encountered up to the start of the matched text */ 164 + private int yyline; 165 + 166 + /** the number of characters up to the start of the matched text */ 167 + private int yychar; 168 + 169 + /** 170 + * the number of characters from the last newline up to the start of the 171 + * matched text 172 + */ 173 + private int yycolumn; 174 + 175 + /** 176 + * zzAtBOL == true <=> the scanner is currently at the beginning of a line 177 + */ 178 + private bool zzAtBOL = true; 179 + 180 + /** zzAtEOF == true <=> the scanner is at the EOF */ 181 + private bool zzAtEOF; 182 + 183 + 184 + /** the stack of open (nested) input streams to read from */ 185 + private System.Collections.Stack zzStreams = new System.Collections.Stack(); 186 + 187 + /** 188 + * inner class used to store info for nested 189 + * input streams 190 + */ 191 + private sealed class ZzFlexStreamInfo { 192 + public System.IO.TextReader zzReader; 193 + public int zzEndRead; 194 + public int zzStartRead; 195 + public int zzCurrentPos; 196 + public int zzMarkedPos; 197 + public int zzPushbackPos; 198 + public int yyline; 199 + public int yycolumn; 200 + public char [] zzBuffer; 201 + public bool zzAtEOF; 202 + 203 + /** sets all values stored in this class */ 204 + public ZzFlexStreamInfo(System.IO.TextReader zzReader, int zzEndRead, int zzStartRead, 205 + int zzCurrentPos, int zzMarkedPos, int zzPushbackPos, 206 + char [] zzBuffer, bool zzAtEOF, int yyline, int yycolumn) { 207 + this.zzReader = zzReader; 208 + this.zzEndRead = zzEndRead; 209 + this.zzStartRead = zzStartRead; 210 + this.zzCurrentPos = zzCurrentPos; 211 + this.zzMarkedPos = zzMarkedPos; 212 + this.zzPushbackPos = zzPushbackPos; 213 + this.zzBuffer = zzBuffer; 214 + this.zzAtEOF = zzAtEOF; 215 + this.yyline = yyline; 216 + this.yycolumn = yycolumn; 217 + } 218 + } 219 + 220 + --- user class code 221 + 222 + /** 223 + * Creates a new scanner 224 + * There is also a java.io.InputStream version of this constructor. 225 + * 226 + * @param in the java.io.Reader to read input from. 227 + */ 228 + --- C# version 229 + 230 + /** 231 + * Creates a new scanner 232 + * There is also a System.IO.Stream version of this constructor. 233 + * 234 + * @param in the System.IO.TextReader to read input from. 235 + */ 236 + --- constructor declaration 237 + 238 + 239 + /** 240 + * Refills the input buffer. 241 + * 242 + * @return <code>false</code>, iff there was new input. 243 + * 244 + * @exception java.io.IOException if any I/O-Error occurs 245 + */ 246 + private boolean zzRefill() throws java.io.IOException { 247 + 248 + /* first: make room (if you can) */ 249 + if (zzStartRead > 0) { 250 + System.arraycopy(zzBuffer, zzStartRead, 251 + zzBuffer, 0, 252 + zzEndRead-zzStartRead); 253 + 254 + /* translate stored positions */ 255 + zzEndRead-= zzStartRead; 256 + zzCurrentPos-= zzStartRead; 257 + zzMarkedPos-= zzStartRead; 258 + zzPushbackPos-= zzStartRead; 259 + zzStartRead = 0; 260 + } 261 + 262 + /* is the buffer big enough? */ 263 + if (zzCurrentPos >= zzBuffer.length) { 264 + /* if not: blow it up */ 265 + char newBuffer[] = new char[zzCurrentPos*2]; 266 + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); 267 + zzBuffer = newBuffer; 268 + } 269 + 270 + /* finally: fill the buffer with new input */ 271 + int numRead = zzReader.read(zzBuffer, zzEndRead, 272 + zzBuffer.length-zzEndRead); 273 + 274 + if (numRead <= 0) { 275 + return true; 276 + } 277 + else { 278 + zzEndRead+= numRead; 279 + return false; 280 + } 281 + } 282 + 283 + 284 + /** 285 + * Closes the input stream. 286 + */ 287 + public final void yyclose() throws java.io.IOException { 288 + zzAtEOF = true; /* indicate end of file */ 289 + zzEndRead = zzStartRead; /* invalidate buffer */ 290 + 291 + if (zzReader != null) 292 + zzReader.close(); 293 + } 294 + 295 + 296 + /** 297 + * Stores the current input stream on a stack, and 298 + * reads from a new stream. Lexical state, line, 299 + * char, and column counting remain untouched. 300 + * 301 + * The current input stream can be restored with 302 + * yypopstream (usually in an <<EOF>> action). 303 + * 304 + * @param reader the new input stream to read from 305 + * 306 + * @see #yypopStream() 307 + */ 308 + public final void yypushStream(java.io.Reader reader) { 309 + zzStreams.push( 310 + new ZzFlexStreamInfo(zzReader, zzEndRead, zzStartRead, zzCurrentPos, 311 + zzMarkedPos, zzPushbackPos, zzBuffer, zzAtEOF, 312 + yyline, yycolumn) 313 + ); 314 + zzAtEOF = false; 315 + zzBuffer = new char[ZZ_BUFFERSIZE]; 316 + zzReader = reader; 317 + zzEndRead = zzStartRead = 0; 318 + zzCurrentPos = zzMarkedPos = zzPushbackPos = 0; 319 + yyline = yycolumn = 0; 320 + } 321 + 322 + 323 + /** 324 + * Closes the current input stream and continues to 325 + * read from the one on top of the stream stack. 326 + * 327 + * @throws java.util.EmptyStackException 328 + * if there is no further stream to read from. 329 + * 330 + * @throws java.io.IOException 331 + * if there was an error in closing the stream. 332 + * 333 + * @see #yypushStream(java.io.Reader) 334 + */ 335 + public final void yypopStream() throws java.io.IOException { 336 + zzReader.close(); 337 + ZzFlexStreamInfo s = (ZzFlexStreamInfo) zzStreams.pop(); 338 + zzBuffer = s.zzBuffer; 339 + zzReader = s.zzReader; 340 + zzEndRead = s.zzEndRead; 341 + zzStartRead = s.zzStartRead; 342 + zzCurrentPos = s.zzCurrentPos; 343 + zzMarkedPos = s.zzMarkedPos ; 344 + zzPushbackPos = s.zzPushbackPos; 345 + zzAtEOF = s.zzAtEOF; 346 + yyline = s.yyline; 347 + yycolumn = s.yycolumn; 348 + } 349 + 350 + 351 + /** 352 + * Returns true iff there are still streams left 353 + * to read from on the stream stack. 354 + */ 355 + public final boolean yymoreStreams() { 356 + return !zzStreams.isEmpty(); 357 + } 358 + 359 + 360 + /** 361 + * Resets the scanner to read from a new input stream. 362 + * Does not close the old reader. 363 + * 364 + * All internal variables are reset, the old input stream 365 + * <b>cannot</b> be reused (internal buffer is discarded and lost). 366 + * Lexical state is set to <tt>ZZ_INITIAL</tt>. 367 + * 368 + * @param reader the new input stream 369 + * 370 + * @see #yypushStream(java.io.Reader) 371 + * @see #yypopStream() 372 + */ 373 + public final void yyreset(java.io.Reader reader) { 374 + zzReader = reader; 375 + zzAtBOL = true; 376 + zzAtEOF = false; 377 + zzEndRead = zzStartRead = 0; 378 + zzCurrentPos = zzMarkedPos = zzPushbackPos = 0; 379 + yyline = yychar = yycolumn = 0; 380 + zzLexicalState = YYINITIAL; 381 + } 382 + 383 + 384 + /** 385 + * Returns the current lexical state. 386 + */ 387 + public final int yystate() { 388 + return zzLexicalState; 389 + } 390 + 391 + 392 + /** 393 + * Enters a new lexical state 394 + * 395 + * @param newState the new lexical state 396 + */ 397 + public final void yybegin(int newState) { 398 + zzLexicalState = newState; 399 + } 400 + 401 + 402 + /** 403 + * Returns the text matched by the current regular expression. 404 + */ 405 + public final String yytext() { 406 + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); 407 + } 408 + 409 + 410 + /** 411 + * Returns the character at position <tt>pos</tt> from the 412 + * matched text. 413 + * 414 + * It is equivalent to yytext().charAt(pos), but faster 415 + * 416 + * @param pos the position of the character to fetch. 417 + * A value from 0 to yylength()-1. 418 + * 419 + * @return the character at position pos 420 + */ 421 + public final char yycharat(int pos) { 422 + return zzBuffer[zzStartRead+pos]; 423 + } 424 + 425 + 426 + /** 427 + * Returns the length of the matched text region. 428 + */ 429 + public final int yylength() { 430 + return zzMarkedPos-zzStartRead; 431 + } 432 + 433 + 434 + /** 435 + * Reports an error that occured while scanning. 436 + * 437 + * In a wellformed scanner (no or only correct usage of 438 + * yypushback(int) and a match-all fallback rule) this method 439 + * will only be called with things that "Can't Possibly Happen". 440 + * If this method is called, something is seriously wrong 441 + * (e.g. a JFlex/CSFlex bug producing a faulty scanner etc.). 442 + * 443 + * Usual syntax/scanner level error handling should be done 444 + * in error fallback rules. 445 + * 446 + * @param errorCode the code of the errormessage to display 447 + */ 448 + --- C# version 449 + 450 + 451 + /** 452 + * Refills the input buffer. 453 + * 454 + * @return <code>false</code>, iff there was new input. 455 + * 456 + * @exception System.IO.IOException if any I/O-Error occurs 457 + */ 458 + private bool zzRefill() { 459 + 460 + /* first: make room (if you can) */ 461 + if (zzStartRead > 0) { 462 + Array.Copy(zzBuffer, zzStartRead, 463 + zzBuffer, 0, 464 + zzEndRead-zzStartRead); 465 + 466 + /* translate stored positions */ 467 + zzEndRead-= zzStartRead; 468 + zzCurrentPos-= zzStartRead; 469 + zzMarkedPos-= zzStartRead; 470 + zzPushbackPos-= zzStartRead; 471 + zzStartRead = 0; 472 + } 473 + 474 + /* is the buffer big enough? */ 475 + if (zzCurrentPos >= zzBuffer.Length) { 476 + /* if not: blow it up */ 477 + char[] newBuffer = new char[zzCurrentPos*2]; 478 + Array.Copy(zzBuffer, 0, newBuffer, 0, zzBuffer.Length); 479 + zzBuffer = newBuffer; 480 + } 481 + 482 + /* finally: fill the buffer with new input */ 483 + int numRead = zzReader.Read(zzBuffer, zzEndRead, 484 + zzBuffer.Length-zzEndRead); 485 + 486 + if (numRead <= 0) { 487 + return true; 488 + } 489 + else { 490 + zzEndRead+= numRead; 491 + return false; 492 + } 493 + } 494 + 495 + 496 + /** 497 + * Closes the input stream. 498 + */ 499 + public void yyclose() { 500 + zzAtEOF = true; /* indicate end of file */ 501 + zzEndRead = zzStartRead; /* invalidate buffer */ 502 + 503 + if (zzReader != null) 504 + zzReader.Close(); 505 + } 506 + 507 + 508 + /** 509 + * Stores the current input stream on a stack, and 510 + * reads from a new stream. Lexical state, line, 511 + * char, and column counting remain untouched. 512 + * 513 + * The current input stream can be restored with 514 + * yypopstream (usually in an <<EOF>> action). 515 + * 516 + * @param reader the new input stream to read from 517 + * 518 + * @see #yypopStream() 519 + */ 520 + public void yypushStream(TextReader reader) { 521 + zzStreams.Push( 522 + new ZzFlexStreamInfo(zzReader, zzEndRead, zzStartRead, zzCurrentPos, 523 + zzMarkedPos, zzPushbackPos, zzBuffer, zzAtEOF, 524 + yyline, yycolumn) 525 + ); 526 + zzAtEOF = false; 527 + zzBuffer = new char[ZZ_BUFFERSIZE]; 528 + zzReader = reader; 529 + zzEndRead = zzStartRead = 0; 530 + zzCurrentPos = zzMarkedPos = zzPushbackPos = 0; 531 + yyline = yycolumn = 0; 532 + } 533 + 534 + 535 + /** 536 + * Closes the current input stream and continues to 537 + * read from the one on top of the stream stack. 538 + * 539 + * @throws System.InvalidOperationException 540 + * if there is no further stream to read from. 541 + * 542 + * @throws System.IO.IOException 543 + * if there was an error in closing the stream. 544 + * 545 + * @see #yypushStream(TextReader) 546 + */ 547 + public void yypopStream() { 548 + zzReader.Close(); 549 + ZzFlexStreamInfo s = (ZzFlexStreamInfo) zzStreams.Pop(); 550 + zzBuffer = s.zzBuffer; 551 + zzReader = s.zzReader; 552 + zzEndRead = s.zzEndRead; 553 + zzStartRead = s.zzStartRead; 554 + zzCurrentPos = s.zzCurrentPos; 555 + zzMarkedPos = s.zzMarkedPos ; 556 + zzPushbackPos = s.zzPushbackPos; 557 + zzAtEOF = s.zzAtEOF; 558 + yyline = s.yyline; 559 + yycolumn = s.yycolumn; 560 + } 561 + 562 + 563 + /** 564 + * Returns true iff there are still streams left 565 + * to read from on the stream stack. 566 + */ 567 + public bool yymoreStreams() { 568 + return zzStreams.Count != 0; 569 + } 570 + 571 + 572 + /** 573 + * Resets the scanner to read from a new input stream. 574 + * Does not close the old reader. 575 + * 576 + * All internal variables are reset, the old input stream 577 + * <b>cannot</b> be reused (internal buffer is discarded and lost). 578 + * Lexical state is set to <tt>ZZ_INITIAL</tt>. 579 + * 580 + * @param reader the new input stream 581 + * 582 + * @see #yypushStream(System.IO.TextReader) 583 + * @see #yypopStream() 584 + */ 585 + public void yyreset(System.IO.TextReader reader) { 586 + zzReader = reader; 587 + zzAtBOL = true; 588 + zzAtEOF = false; 589 + zzEndRead = zzStartRead = 0; 590 + zzCurrentPos = zzMarkedPos = zzPushbackPos = 0; 591 + yyline = yychar = yycolumn = 0; 592 + zzLexicalState = YYINITIAL; 593 + } 594 + 595 + 596 + /** 597 + * Returns the current lexical state. 598 + */ 599 + public int yystate() { 600 + return zzLexicalState; 601 + } 602 + 603 + 604 + /** 605 + * Enters a new lexical state 606 + * 607 + * @param newState the new lexical state 608 + */ 609 + public void yybegin(int newState) { 610 + zzLexicalState = newState; 611 + } 612 + 613 + 614 + /** 615 + * Returns the text matched by the current regular expression. 616 + */ 617 + public String yytext() { 618 + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); 619 + } 620 + 621 + 622 + /** 623 + * Returns the character at position <tt>pos</tt> from the 624 + * matched text. 625 + * 626 + * It is equivalent to yytext().charAt(pos), but faster 627 + * 628 + * @param pos the position of the character to fetch. 629 + * A value from 0 to yylength()-1. 630 + * 631 + * @return the character at position pos 632 + */ 633 + public char yycharat(int pos) { 634 + return zzBuffer[zzStartRead+pos]; 635 + } 636 + 637 + 638 + /** 639 + * Returns the length of the matched text region. 640 + */ 641 + public int yylength() { 642 + return zzMarkedPos-zzStartRead; 643 + } 644 + 645 + 646 + /** 647 + * Reports an error that occured while scanning. 648 + * 649 + * In a wellformed scanner (no or only correct usage of 650 + * yypushback(int) and a match-all fallback rule) this method 651 + * will only be called with things that "Can't Possibly Happen". 652 + * If this method is called, something is seriously wrong 653 + * (e.g. a JFlex/CSFlex bug producing a faulty scanner etc.). 654 + * 655 + * Usual syntax/scanner level error handling should be done 656 + * in error fallback rules. 657 + * 658 + * @param errorCode the code of the errormessage to display 659 + */ 660 + --- zzScanError declaration 661 + String message; 662 + try { 663 + message = ZZ_ERROR_MSG[errorCode]; 664 + } 665 + catch (ArrayIndexOutOfBoundsException e) { 666 + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; 667 + } 668 + 669 + --- C# version 670 + String message; 671 + try { 672 + message = ZZ_ERROR_MSG[errorCode]; 673 + } 674 + catch (IndexOutOfRangeException) { 675 + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; 676 + } 677 + 678 + --- throws clause 679 + } 680 + 681 + 682 + /** 683 + * Pushes the specified amount of characters back into the input stream. 684 + * 685 + * They will be read again by then next call of the scanning method 686 + * 687 + * @param number the number of characters to be read again. 688 + * This number must not be greater than yylength()! 689 + */ 690 + --- C# version (identical in this case) 691 + } 692 + 693 + 694 + /** 695 + * Pushes the specified amount of characters back into the input stream. 696 + * 697 + * They will be read again by then next call of the scanning method 698 + * 699 + * @param number the number of characters to be read again. 700 + * This number must not be greater than yylength()! 701 + */ 702 + --- yypushback decl (contains zzScanError exception) 703 + if ( number > yylength() ) 704 + zzScanError(ZZ_PUSHBACK_2BIG); 705 + 706 + zzMarkedPos -= number; 707 + } 708 + 709 + 710 + --- C# version (identical in this case) 711 + if ( number > yylength() ) 712 + zzScanError(ZZ_PUSHBACK_2BIG); 713 + 714 + zzMarkedPos -= number; 715 + } 716 + 717 + 718 + --- zzDoEOF 719 + /** 720 + * Resumes scanning until the next regular expression is matched, 721 + * the end of input is encountered or an I/O-Error occurs. 722 + * 723 + * @return the next token 724 + * @exception java.io.IOException if any I/O-Error occurs 725 + */ 726 + --- C# version 727 + /** 728 + * Resumes scanning until the next regular expression is matched, 729 + * the end of input is encountered or an I/O-Error occurs. 730 + * 731 + * @return the next token 732 + * @exception System.IO.IOException if any I/O-Error occurs 733 + */ 734 + --- yylex declaration 735 + int zzInput; 736 + int zzAction; 737 + 738 + --- C# version 739 + int zzInput = 0; 740 + int zzAction; 741 + 742 + --- local declarations 743 + 744 + while (true) { 745 + // cached fields: 746 + int zzCurrentPosL; 747 + int zzMarkedPosL = zzMarkedPos; 748 + int zzEndReadL = zzEndRead; 749 + char [] zzBufferL = zzBuffer; 750 + char [] zzCMapL = ZZ_CMAP; 751 + 752 + --- C# version (identical in this case) 753 + 754 + while (true) { 755 + // cached fields: 756 + int zzCurrentPosL; 757 + int zzMarkedPosL = zzMarkedPos; 758 + int zzEndReadL = zzEndRead; 759 + char [] zzBufferL = zzBuffer; 760 + char [] zzCMapL = ZZ_CMAP; 761 + 762 + --- start admin (line, char, col count) 763 + zzAction = -1; 764 + 765 + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; 766 + 767 + --- C# version (identical in this case) 768 + zzAction = -1; 769 + 770 + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; 771 + 772 + --- start admin (lexstate etc) 773 + 774 + zzForAction: { 775 + while (true) { 776 + 777 + --- C# version 778 + 779 + while (true) { 780 + goto zzForAction_skip; 781 + zzForAction: break; 782 + zzForAction_skip: 783 + if (!ZZ_SPURIOUS_WARNINGS_SUCK) goto zzForAction; 784 + 785 + --- next input, line, col, char count, next transition, isFinal action 786 + zzAction = zzState; 787 + zzMarkedPosL = zzCurrentPosL; 788 + --- C# version (identcal in this case) 789 + zzAction = zzState; 790 + zzMarkedPosL = zzCurrentPosL; 791 + --- line count update 792 + } 793 + 794 + } 795 + } 796 + 797 + // store back cached position 798 + zzMarkedPos = zzMarkedPosL; 799 + --- C# version 800 + } 801 + 802 + } 803 + 804 + // store back cached position 805 + zzMarkedPos = zzMarkedPosL; 806 + --- char count update 807 + 808 + --- C# version (identical in this case) 809 + 810 + --- actions 811 + default: 812 + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { 813 + zzAtEOF = true; 814 + --- C# version (identical in this case) 815 + default: 816 + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { 817 + zzAtEOF = true; 818 + --- eofvalue 819 + } 820 + else { 821 + --- C# version (identical in this case) 822 + } 823 + else { 824 + --- no match 825 + } 826 + } 827 + } 828 + } 829 + 830 + --- C# version 831 + } 832 + break; 833 + } 834 + } 835 + } 836 + 837 + --- main 838 + 839 + } 840 + --- C# version (identical in this case) 841 + 842 + }
-2174
Prexonite/Compiler/Lexer.cs
··· 1 - /* The following code was generated by CSFlex 1.4 on 2023-12-09 */ 2 - 3 - #line 1 "Prexonite.lex" 4 - #nullable disable 5 - // ReSharper disable ArrangeTypeMemberModifiers 6 - // ReSharper disable InvalidXmlDocComment 7 - // ReSharper disable InconsistentNaming 8 - // ReSharper disable IdentifierTypo 9 - // ReSharper disable MemberCanBePrivate.Global 10 - // ReSharper disable CheckNamespace 11 - // ReSharper disable RedundantUsingDirective 12 - // ReSharper disable RedundantArrayCreationExpression 13 - // ReSharper disable RedundantAssignment 14 - // ReSharper disable RedundantExplicitArrayCreation 15 - // ReSharper disable RedundantNameQualifier 16 - // ReSharper disable RedundantJumpStatement 17 - // ReSharper disable PossibleNullReferenceException 18 - 19 - //Prexonite Scanner file. 20 - 21 - using System; 22 - using System.Text; 23 - using System.IO; 24 - using Prexonite; 25 - using Prexonite.Types; 26 - using Prexonite.Commands; 27 - using Prexonite.Compiler; 28 - using Prexonite.Compiler.Ast; 29 - 30 - partial 31 - 32 - #line default 33 - /** 34 - * This class is a scanner generated by <a href="http://www.sourceforge.net/projects/csflex/">C# Flex</a>, based on 35 - * <a href="http://www.jflex.de/">JFlex</a>, version 1.4 36 - * on 2023-12-09 from the specification file 37 - * <tt>Prexonite.lex</tt> 38 - */ 39 - class Lexer: Prexonite.Internal.IScanner { 40 - 41 - /** This character denotes the end of file */ 42 - public const int YYEOF = -1; 43 - 44 - /** initial size of the lookahead buffer */ 45 - private const int ZZ_BUFFERSIZE = 16384; 46 - /** 47 - * This is used in 'if' statements to eliminate dead code 48 - * warnings for 'break;' after the end of a user action 49 - * block of code. The Java version does this by emitting 50 - * a second 'case' which is impossible to reach. Since this 51 - * is impossible for the compiler to deduce during semantic 52 - * analysis, the warning is stifled. However, C# does not 53 - * permit 'case' blocks to flow into each other, so the C# 54 - * output mode needs a different approach. In this case, 55 - * the entire user code is wrapped up in an 'if' statement 56 - * whose condition is always true. No warning is emitted 57 - * because the compiler doesn't strictly propagate the value 58 - * of 'static readonly' fields, and thus does not semantically 59 - * detect the fact that the 'if' will always be true. 60 - */ 61 - public static readonly bool ZZ_SPURIOUS_WARNINGS_SUCK = true; 62 - 63 - /** lexical states */ 64 - public const int VerbatimString = 3; 65 - public const int LocalShell = 7; 66 - public const int Local = 6; 67 - public const int VerbatimBlock = 5; 68 - public const int YYINITIAL = 0; 69 - public const int SmartString = 2; 70 - public const int Asm = 8; 71 - public const int Transfer = 9; 72 - public const int String = 1; 73 - public const int SmartVerbatimString = 4; 74 - static Lexer() 75 - { 76 - ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); 77 - ZZ_ACTION = zzUnpackAction(); 78 - ZZ_ROWMAP = zzUnpackRowMap(); 79 - ZZ_TRANS = zzUnpackTrans(); 80 - ZZ_ATTRIBUTE = zzUnpackAttribute(); 81 - } 82 - 83 - 84 - /** 85 - * Translates characters to character classes 86 - */ 87 - private static readonly ushort[] ZZ_CMAP_PACKED = [ 88 - 9, 9, 1, 12, 1, 10, 3, 10, 14, 9, 4, 0, 1, 12, 1, 20, 1, 13, 1, 19, 89 - 1, 14, 1, 0, 1, 41, 1, 3, 1, 24, 1, 25, 1, 16, 1, 5, 1, 50, 1, 6, 90 - 1, 27, 1, 15, 1, 28, 9, 1, 1, 36, 1, 49, 1, 44, 1, 26, 1, 43, 1, 48, 91 - 1, 23, 1, 33, 1, 51, 1, 2, 1, 21, 1, 4, 1, 32, 5, 7, 1, 34, 1, 39, 92 - 1, 52, 1, 18, 2, 7, 1, 30, 1, 22, 1, 17, 1, 31, 1, 35, 1, 7, 1, 29, 93 - 2, 7, 1, 38, 1, 8, 1, 45, 1, 40, 1, 7, 1, 0, 1, 33, 1, 51, 1, 2, 94 - 1, 21, 1, 4, 1, 32, 5, 7, 1, 34, 1, 39, 1, 52, 1, 18, 2, 7, 1, 30, 95 - 1, 22, 1, 17, 1, 31, 1, 35, 1, 7, 1, 29, 2, 7, 1, 37, 1, 42, 1, 46, 96 - 1, 47, 6, 9, 1, 11, 26, 9, 2, 0, 4, 7, 4, 0, 1, 7, 7, 0, 2, 9, 97 - 1, 0, 1, 7, 3, 0, 1, 9, 1, 7, 5, 0, 23, 7, 1, 0, 31, 7, 1, 0, 98 - 0x0128, 7, 2, 0, 18, 7, 28, 0, 94, 7, 2, 0, 9, 7, 2, 0, 7, 7, 14, 0, 99 - 2, 7, 14, 0, 5, 7, 9, 0, 1, 7, 17, 0, 70, 9, 26, 0, 2, 9, 24, 0, 100 - 1, 7, 11, 0, 1, 7, 1, 0, 3, 7, 1, 0, 1, 7, 1, 0, 20, 7, 1, 0, 101 - 44, 7, 1, 0, 8, 7, 2, 0, 26, 7, 12, 0, 130, 7, 1, 0, 4, 9, 5, 0, 102 - 57, 7, 2, 0, 2, 7, 2, 0, 2, 7, 3, 0, 38, 7, 2, 0, 2, 7, 55, 0, 103 - 38, 7, 2, 0, 1, 7, 7, 0, 39, 7, 9, 0, 41, 9, 1, 0, 3, 9, 1, 0, 104 - 1, 9, 1, 0, 2, 9, 1, 0, 1, 9, 11, 0, 27, 7, 5, 0, 3, 7, 46, 0, 105 - 26, 7, 5, 0, 11, 7, 8, 9, 13, 0, 10, 9, 6, 0, 1, 9, 99, 7, 1, 0, 106 - 1, 7, 7, 9, 2, 0, 6, 9, 2, 7, 2, 9, 1, 0, 4, 9, 2, 0, 10, 9, 107 - 3, 7, 19, 0, 1, 7, 1, 0, 27, 7, 83, 0, 38, 7, 0x015b, 0, 3, 9, 1, 0, 108 - 53, 7, 2, 0, 1, 9, 1, 7, 16, 9, 2, 0, 1, 7, 4, 9, 3, 0, 10, 7, 109 - 2, 9, 2, 0, 10, 9, 17, 0, 3, 9, 1, 0, 8, 7, 2, 0, 2, 7, 2, 0, 110 - 22, 7, 1, 0, 7, 7, 1, 0, 1, 7, 3, 0, 4, 7, 2, 0, 1, 9, 1, 0, 111 - 7, 9, 2, 0, 2, 9, 2, 0, 3, 9, 9, 0, 1, 9, 4, 0, 2, 7, 1, 0, 112 - 3, 7, 2, 9, 2, 0, 10, 9, 4, 7, 4, 9, 1, 0, 1, 9, 8, 0, 1, 9, 113 - 2, 0, 6, 7, 4, 0, 2, 7, 2, 0, 22, 7, 1, 0, 7, 7, 1, 0, 2, 7, 114 - 1, 0, 2, 7, 1, 0, 2, 7, 2, 0, 1, 9, 1, 0, 5, 9, 4, 0, 2, 9, 115 - 2, 0, 3, 9, 11, 0, 4, 7, 1, 0, 1, 7, 7, 0, 12, 9, 3, 7, 12, 0, 116 - 3, 9, 1, 0, 7, 7, 1, 0, 1, 7, 1, 0, 3, 7, 1, 0, 22, 7, 1, 0, 117 - 7, 7, 1, 0, 2, 7, 1, 0, 5, 7, 2, 0, 1, 9, 1, 7, 8, 9, 1, 0, 118 - 3, 9, 1, 0, 3, 9, 2, 0, 1, 7, 15, 0, 1, 7, 5, 0, 10, 9, 17, 0, 119 - 3, 9, 1, 0, 8, 7, 2, 0, 2, 7, 2, 0, 22, 7, 1, 0, 7, 7, 1, 0, 120 - 2, 7, 2, 0, 4, 7, 2, 0, 1, 9, 1, 7, 6, 9, 3, 0, 7, 9, 8, 0, 121 - 2, 9, 4, 0, 2, 7, 1, 0, 3, 7, 4, 0, 10, 9, 18, 0, 2, 9, 1, 0, 122 - 6, 7, 3, 0, 3, 7, 1, 0, 4, 7, 3, 0, 2, 7, 1, 0, 1, 7, 1, 0, 123 - 2, 7, 3, 0, 2, 7, 3, 0, 3, 7, 3, 0, 8, 7, 1, 0, 3, 7, 4, 0, 124 - 71, 9, 8, 7, 1, 9, 3, 7, 1, 9, 23, 7, 1, 9, 10, 7, 1, 9, 5, 7, 125 - 11, 9, 1, 0, 3, 9, 1, 0, 4, 9, 7, 0, 2, 9, 9, 0, 2, 7, 4, 0, 126 - 10, 9, 18, 0, 2, 9, 1, 0, 8, 7, 1, 0, 3, 7, 1, 0, 23, 7, 1, 0, 127 - 10, 7, 1, 0, 5, 7, 4, 0, 7, 9, 1, 0, 3, 9, 1, 0, 4, 9, 7, 0, 128 - 2, 9, 7, 0, 1, 7, 1, 0, 2, 7, 4, 0, 10, 9, 18, 0, 2, 9, 1, 0, 129 - 8, 7, 1, 0, 3, 7, 1, 0, 23, 7, 1, 0, 16, 7, 4, 0, 6, 9, 2, 0, 130 - 3, 9, 1, 0, 4, 9, 9, 0, 1, 9, 8, 0, 2, 7, 4, 0, 10, 9, 21, 0, 131 - 18, 7, 3, 0, 24, 7, 1, 0, 9, 7, 1, 0, 1, 7, 2, 0, 7, 7, 58, 0, 132 - 48, 7, 1, 9, 2, 7, 7, 9, 4, 0, 8, 7, 8, 9, 1, 0, 10, 9, 39, 0, 133 - 2, 7, 1, 0, 1, 7, 2, 0, 2, 7, 1, 0, 1, 7, 2, 0, 1, 7, 6, 0, 134 - 4, 7, 1, 0, 7, 7, 1, 0, 3, 7, 1, 0, 1, 7, 1, 0, 1, 7, 2, 0, 135 - 2, 7, 1, 0, 4, 7, 1, 9, 2, 7, 6, 9, 1, 0, 2, 9, 1, 7, 2, 0, 136 - 5, 7, 1, 0, 1, 7, 1, 0, 6, 9, 2, 0, 10, 9, 2, 0, 2, 7, 34, 0, 137 - 1, 7, 23, 0, 2, 9, 6, 0, 10, 9, 11, 0, 1, 9, 1, 0, 1, 9, 1, 0, 138 - 1, 9, 4, 0, 2, 9, 8, 7, 1, 0, 34, 7, 6, 0, 23, 9, 4, 7, 4, 0, 139 - 6, 9, 1, 0, 1, 9, 1, 0, 21, 9, 3, 0, 7, 9, 1, 0, 1, 9, 70, 0, 140 - 34, 7, 1, 0, 5, 7, 1, 0, 2, 7, 37, 0, 6, 7, 74, 0, 38, 7, 10, 0, 141 - 39, 7, 9, 0, 90, 7, 5, 0, 68, 7, 5, 0, 82, 7, 6, 0, 7, 7, 1, 0, 142 - 63, 7, 1, 0, 1, 7, 1, 0, 4, 7, 2, 0, 7, 7, 1, 0, 1, 7, 1, 0, 143 - 4, 7, 2, 0, 39, 7, 1, 0, 1, 7, 1, 0, 4, 7, 2, 0, 31, 7, 1, 0, 144 - 1, 7, 1, 0, 4, 7, 2, 0, 7, 7, 1, 0, 1, 7, 1, 0, 4, 7, 2, 0, 145 - 7, 7, 1, 0, 7, 7, 1, 0, 23, 7, 1, 0, 31, 7, 1, 0, 1, 7, 1, 0, 146 - 4, 7, 2, 0, 7, 7, 1, 0, 39, 7, 1, 0, 19, 7, 69, 0, 85, 7, 12, 0, 147 - 0x026c, 7, 2, 0, 8, 7, 10, 0, 26, 7, 5, 0, 75, 7, 149, 0, 52, 7, 108, 0, 148 - 88, 7, 8, 0, 41, 7, 0x0557, 0, 156, 7, 4, 0, 90, 7, 6, 0, 22, 7, 2, 0, 149 - 6, 7, 2, 0, 38, 7, 2, 0, 6, 7, 2, 0, 8, 7, 1, 0, 1, 7, 1, 0, 150 - 1, 7, 1, 0, 1, 7, 1, 0, 31, 7, 2, 0, 53, 7, 1, 0, 7, 7, 1, 0, 151 - 1, 7, 3, 0, 3, 7, 1, 0, 7, 7, 3, 0, 4, 7, 2, 0, 6, 7, 4, 0, 152 - 13, 7, 5, 0, 3, 7, 1, 0, 7, 7, 15, 0, 4, 9, 24, 0, 2, 10, 5, 9, 153 - 16, 0, 2, 7, 41, 0, 7, 9, 3, 0, 6, 9, 5, 0, 1, 7, 10, 9, 22, 0, 154 - 12, 7, 36, 0, 13, 9, 4, 0, 1, 9, 32, 0, 1, 7, 4, 0, 1, 7, 2, 0, 155 - 10, 7, 1, 0, 1, 7, 3, 0, 5, 7, 6, 0, 1, 7, 1, 0, 1, 7, 1, 0, 156 - 1, 7, 1, 0, 4, 7, 1, 0, 3, 7, 1, 0, 7, 7, 37, 0, 36, 9, 0x02dd, 0, 157 - 60, 9, 78, 0, 1, 9, 0x028b, 0, 30, 9, 0x0871, 0, 2, 7, 1, 9, 25, 0, 15, 9, 158 - 1, 0, 5, 7, 11, 0, 84, 7, 4, 0, 2, 9, 2, 0, 2, 7, 2, 0, 90, 7, 159 - 1, 0, 3, 7, 6, 0, 40, 7, 4, 0, 94, 7, 17, 0, 24, 7, 200, 0, 10, 9, 160 - 0x0176, 0, 0x19b6, 7, 74, 0, 0x51a6, 7, 90, 0, 0x048d, 7, 0x0773, 0, 0x2ba4, 7, 0x215c, 0, 0x012e, 7, 161 - 210, 0, 7, 7, 12, 0, 5, 7, 5, 0, 1, 7, 1, 0, 10, 7, 1, 0, 13, 7, 162 - 1, 0, 5, 7, 1, 0, 1, 7, 1, 0, 2, 7, 1, 0, 2, 7, 1, 0, 108, 7, 163 - 33, 0, 0x016b, 7, 18, 0, 64, 7, 2, 0, 54, 7, 40, 0, 12, 7, 55, 0, 2, 7, 164 - 24, 0, 3, 7, 25, 0, 1, 7, 6, 0, 3, 7, 1, 0, 1, 7, 1, 0, 135, 7, 165 - 2, 0, 1, 9, 4, 0, 1, 7, 11, 0, 10, 9, 7, 0, 26, 7, 4, 0, 1, 7, 166 - 1, 0, 26, 7, 11, 0, 89, 7, 3, 0, 6, 7, 2, 0, 6, 7, 2, 0, 6, 7, 167 - 2, 0, 3, 7, 3, 0, 2, 7, 3, 0, 2, 7, 25, 0, 0, 168 - ]; 169 - 170 - /** 171 - * Translates characters to character classes 172 - */ 173 - private static readonly char[] ZZ_CMAP; 174 - 175 - /** 176 - * Translates DFA states to action switch labels. 177 - */ 178 - private static readonly int [] ZZ_ACTION; 179 - 180 - private static readonly ushort[] ZZ_ACTION_PACKED_0 = [ 181 - 10, 0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 182 - 1, 3, 1, 8, 1, 9, 1, 3, 1, 1, 1, 10, 1, 3, 1, 11, 183 - 1, 12, 1, 13, 1, 14, 1, 15, 1, 2, 3, 3, 1, 16, 1, 17, 184 - 1, 18, 1, 19, 1, 20, 1, 21, 1, 22, 1, 23, 1, 24, 1, 25, 185 - 1, 26, 1, 27, 1, 28, 1, 29, 1, 30, 2, 31, 1, 32, 1, 33, 186 - 1, 34, 2, 35, 1, 36, 1, 35, 1, 37, 1, 38, 1, 39, 1, 40, 187 - 1, 41, 1, 31, 1, 42, 1, 3, 1, 11, 1, 5, 1, 12, 2, 0, 188 - 1, 43, 1, 44, 1, 45, 1, 46, 1, 47, 1, 48, 1, 6, 1, 0, 189 - 1, 49, 1, 3, 1, 50, 1, 51, 1, 3, 1, 52, 14, 0, 1, 53, 190 - 1, 54, 1, 0, 3, 3, 1, 55, 1, 56, 1, 57, 1, 58, 1, 59, 191 - 1, 60, 1, 61, 1, 62, 1, 63, 1, 64, 1, 65, 1, 66, 1, 67, 192 - 1, 68, 1, 0, 1, 69, 1, 0, 1, 70, 1, 71, 1, 72, 1, 73, 193 - 1, 74, 1, 75, 1, 76, 1, 77, 1, 78, 1, 79, 1, 80, 1, 0, 194 - 1, 81, 1, 0, 1, 82, 1, 83, 1, 84, 1, 85, 1, 86, 1, 87, 195 - 1, 88, 1, 89, 1, 90, 1, 91, 1, 92, 1, 93, 1, 94, 1, 95, 196 - 1, 44, 1, 0, 1, 96, 1, 97, 2, 0, 2, 3, 1, 0, 1, 98, 197 - 1, 0, 1, 99, 1, 0, 1, 100, 1, 101, 6, 0, 1, 102, 1, 103, 198 - 1, 104, 1, 0, 1, 105, 1, 0, 1, 106, 2, 0, 1, 2, 1, 107, 199 - 1, 3, 1, 108, 1, 109, 1, 0, 1, 110, 1, 0, 1, 88, 1, 92, 200 - 1, 95, 1, 111, 2, 0, 1, 112, 1, 6, 1, 113, 1, 114, 1, 115, 201 - 1, 116, 1, 117, 1, 118, 1, 119, 4, 0, 1, 120, 1, 0, 1, 121, 202 - 1, 122, 1, 123, 1, 0, 1, 3, 1, 109, 1, 0, 1, 110, 1, 0, 203 - 1, 124, 1, 0, 1, 125, 1, 126, 1, 127, 1, 128, 1, 129, 1, 130, 204 - 1, 131, 1, 132, 1, 109, 1, 0, 1, 110, 2, 0, 2, 109, 2, 110, 205 - 1, 125, 6, 0, 0, 206 - ]; 207 - 208 - private static int [] zzUnpackAction() { 209 - int [] result = new int[243]; 210 - int offset = 0; 211 - offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); 212 - return result; 213 - } 214 - 215 - private static int zzUnpackAction(ushort[] packed, int offset, int [] result) { 216 - int i = 0; /* index in packed string */ 217 - int j = offset; /* index in unpacked array */ 218 - int l = packed.Length; 219 - while (i + 1 < l) { 220 - int count = packed[i++]; 221 - int value = packed[i++]; 222 - do result[j++] = value; while (--count > 0); 223 - } 224 - return j; 225 - } 226 - 227 - 228 - /** 229 - * Translates a state to a row index in the transition table 230 - */ 231 - private static readonly int [] ZZ_ROWMAP; 232 - 233 - private static readonly ushort[] ZZ_ROWMAP_PACKED_0 = [ 234 - 0, 0, 0, 53, 0, 106, 0, 159, 0, 212, 0, 0x0109, 0, 0x013e, 0, 0x0173, 235 - 0, 0x01a8, 0, 0x01dd, 0, 0x0212, 0, 0x0247, 0, 0x027c, 0, 0x02b1, 0, 0x02e6, 0, 0x031b, 236 - 0, 0x0212, 0, 0x0350, 0, 0x0385, 0, 0x0212, 0, 0x03ba, 0, 0x03ef, 0, 0x0424, 0, 0x0459, 237 - 0, 0x048e, 0, 0x04c3, 0, 0x0212, 0, 0x04f8, 0, 0x0212, 0, 0x052d, 0, 0x0562, 0, 0x0597, 238 - 0, 0x05cc, 0, 0x0601, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0636, 0, 0x066b, 0, 0x06a0, 239 - 0, 0x06d5, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x070a, 0, 0x0212, 0, 0x0212, 0, 0x073f, 240 - 0, 0x0774, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x07a9, 0, 0x07de, 0, 0x0212, 0, 0x0212, 241 - 0, 0x0813, 0, 0x0212, 0, 0x0848, 0, 0x0212, 0, 0x0212, 0, 0x087d, 0, 0x08b2, 0, 0x0212, 242 - 0, 0x08e7, 0, 0x091c, 0, 0x0951, 0, 0x0986, 0, 0x09bb, 0, 0x09f0, 0, 0x0212, 0, 0x0212, 243 - 0, 0x0212, 0, 0x0a25, 0, 0x0212, 0, 0x0212, 0, 0x0a5a, 0, 0x0a8f, 0, 0x027c, 0, 0x0ac4, 244 - 0, 0x0af9, 0, 0x0212, 0, 0x0b2e, 0, 0x0212, 0, 0x0b63, 0, 0x0b98, 0, 0x0bcd, 0, 0x0c02, 245 - 0, 0x0c37, 0, 0x0c6c, 0, 0x0ca1, 0, 0x0cd6, 0, 0x0d0b, 0, 0x0d40, 0, 0x0d75, 0, 0x0daa, 246 - 0, 0x0ddf, 0, 0x0e14, 0, 0x0212, 0, 0x0212, 0, 0x0e49, 0, 0x0e7e, 0, 0x0eb3, 0, 0x0ee8, 247 - 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0212, 248 - 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0f1d, 0, 0x0212, 249 - 0, 0x0f52, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0212, 250 - 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0f87, 0, 0x0212, 0, 0x0fbc, 0, 0x0212, 251 - 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0ff1, 0, 0x0212, 0, 0x0212, 252 - 0, 0x0212, 0, 0x1026, 0, 0x0212, 0, 0x0212, 0, 0x105b, 0, 0x1090, 0, 0x10c5, 0, 0x10fa, 253 - 0, 0x0212, 0, 0x112f, 0, 0x1164, 0, 0x1199, 0, 0x11ce, 0, 0x1203, 0, 0x0212, 0, 0x1238, 254 - 0, 0x0212, 0, 0x126d, 0, 0x0212, 0, 0x0212, 0, 0x12a2, 0, 0x12d7, 0, 0x130c, 0, 0x1341, 255 - 0, 0x1376, 0, 0x13ab, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x13e0, 0, 0x0212, 0, 0x1415, 256 - 0, 0x0212, 0, 0x144a, 0, 0x147f, 0, 0x0e49, 0, 0x027c, 0, 0x14b4, 0, 0x027c, 0, 0x14e9, 257 - 0, 0x151e, 0, 0x1553, 0, 0x1588, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x15bd, 258 - 0, 0x15f2, 0, 0x0212, 0, 0x0212, 0, 0x027c, 0, 0x027c, 0, 0x0212, 0, 0x0212, 0, 0x0212, 259 - 0, 0x0212, 0, 0x0212, 0, 0x1627, 0, 0x165c, 0, 0x1691, 0, 0x16c6, 0, 0x0212, 0, 0x16fb, 260 - 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x1730, 0, 0x1765, 0, 0x179a, 0, 0x17cf, 0, 0x1804, 261 - 0, 0x1839, 0, 0x186e, 0, 0x18a3, 0, 0x18d8, 0, 0x0212, 0, 0x0212, 0, 0x0212, 0, 0x0212, 262 - 0, 0x0212, 0, 0x0212, 0, 0x027c, 0, 0x190d, 0, 0x1942, 0, 0x1977, 0, 0x19ac, 0, 0x19e1, 263 - 0, 0x0212, 0, 0x1a16, 0, 0x0212, 0, 0x1a4b, 0, 0x1a80, 0, 0x1ab5, 0, 0x1aea, 0, 0x1b1f, 264 - 0, 0x1b54, 0, 0x190d, 0, 0x1977, 0, 265 - ]; 266 - 267 - private static int [] zzUnpackRowMap() { 268 - int [] result = new int[243]; 269 - int offset = 0; 270 - offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); 271 - return result; 272 - } 273 - 274 - private static int zzUnpackRowMap(ushort[] packed, int offset, int [] result) { 275 - int i = 0; /* index in packed string */ 276 - int j = offset; /* index in unpacked array */ 277 - int l = packed.Length; 278 - while (i + 1 < l) { 279 - int high = packed[i++] << 16; 280 - result[j++] = high | packed[i++]; 281 - } 282 - return j; 283 - } 284 - 285 - /** 286 - * The transition table of the DFA 287 - */ 288 - private static readonly int [] ZZ_TRANS; 289 - 290 - private static readonly ushort[] ZZ_TRANS_PACKED_0 = [ 291 - 1, 11, 1, 12, 1, 13, 1, 11, 1, 13, 1, 14, 1, 15, 2, 13, 292 - 1, 11, 3, 16, 1, 17, 1, 18, 1, 19, 1, 20, 1, 21, 1, 13, 293 - 1, 22, 1, 23, 1, 24, 1, 13, 1, 25, 1, 26, 1, 27, 1, 28, 294 - 1, 29, 1, 30, 1, 13, 1, 31, 1, 13, 1, 32, 2, 13, 1, 33, 295 - 1, 34, 1, 35, 1, 36, 1, 13, 1, 37, 1, 38, 1, 39, 1, 40, 296 - 1, 41, 1, 42, 1, 43, 1, 44, 1, 45, 1, 46, 1, 47, 2, 13, 297 - 8, 48, 1, 49, 1, 48, 2, 50, 1, 48, 1, 51, 1, 52, 38, 48, 298 - 8, 53, 1, 54, 1, 53, 2, 55, 1, 53, 1, 56, 1, 57, 38, 53, 299 - 13, 58, 1, 59, 1, 60, 38, 58, 13, 61, 1, 62, 1, 63, 38, 61, 300 - 53, 50, 1, 11, 1, 12, 1, 13, 1, 11, 1, 13, 1, 14, 1, 15, 301 - 2, 13, 1, 11, 3, 16, 1, 64, 1, 18, 1, 19, 1, 20, 1, 65, 302 - 1, 13, 1, 11, 1, 23, 1, 24, 1, 13, 1, 66, 1, 26, 1, 27, 303 - 1, 28, 1, 29, 1, 30, 1, 13, 1, 31, 1, 13, 1, 32, 2, 13, 304 - 1, 33, 1, 34, 1, 35, 1, 36, 1, 13, 1, 37, 1, 38, 1, 39, 305 - 1, 40, 1, 41, 1, 42, 1, 43, 1, 44, 1, 45, 1, 46, 1, 47, 306 - 2, 13, 1, 11, 1, 12, 1, 13, 1, 11, 1, 13, 1, 14, 1, 67, 307 - 2, 13, 1, 11, 3, 16, 1, 64, 1, 18, 1, 19, 1, 20, 1, 65, 308 - 1, 13, 1, 11, 1, 23, 1, 24, 1, 13, 1, 66, 1, 26, 1, 27, 309 - 1, 28, 1, 29, 1, 30, 1, 13, 1, 31, 1, 13, 1, 32, 2, 13, 310 - 1, 33, 1, 34, 1, 35, 1, 36, 1, 13, 1, 37, 1, 38, 1, 39, 311 - 1, 40, 1, 41, 1, 42, 1, 43, 1, 44, 1, 45, 1, 46, 1, 47, 312 - 2, 13, 1, 11, 1, 12, 1, 13, 1, 11, 1, 13, 1, 14, 1, 15, 313 - 2, 13, 1, 11, 3, 16, 1, 17, 1, 18, 1, 19, 1, 20, 1, 65, 314 - 1, 13, 1, 11, 1, 23, 2, 13, 1, 25, 1, 26, 1, 27, 1, 28, 315 - 1, 29, 1, 30, 1, 13, 1, 31, 1, 13, 1, 32, 2, 13, 1, 33, 316 - 1, 34, 1, 35, 1, 36, 1, 13, 1, 37, 1, 38, 1, 39, 1, 40, 317 - 1, 41, 1, 42, 1, 43, 1, 44, 1, 45, 1, 46, 1, 47, 2, 13, 318 - 1, 11, 1, 12, 1, 13, 1, 11, 1, 13, 1, 14, 1, 15, 2, 13, 319 - 1, 11, 3, 16, 1, 17, 1, 18, 1, 19, 1, 20, 1, 65, 1, 13, 320 - 1, 11, 1, 23, 2, 13, 1, 25, 1, 68, 1, 27, 1, 28, 1, 29, 321 - 1, 30, 1, 13, 1, 31, 1, 13, 1, 32, 2, 13, 1, 33, 1, 34, 322 - 1, 35, 1, 36, 1, 13, 1, 37, 1, 38, 1, 39, 1, 40, 1, 41, 323 - 1, 42, 1, 43, 1, 44, 1, 45, 1, 46, 1, 47, 2, 13, 54, 0, 324 - 1, 12, 1, 0, 1, 12, 23, 0, 1, 69, 1, 12, 25, 0, 4, 13, 325 - 2, 0, 3, 13, 1, 0, 1, 13, 2, 0, 1, 13, 2, 0, 2, 13, 326 - 2, 0, 2, 13, 5, 0, 8, 13, 1, 70, 2, 0, 1, 13, 11, 0, 327 - 2, 13, 5, 0, 1, 71, 53, 0, 1, 72, 36, 0, 1, 73, 19, 0, 328 - 3, 16, 41, 0, 1, 13, 1, 74, 1, 13, 1, 74, 2, 0, 2, 74, 329 - 1, 13, 1, 0, 1, 13, 1, 0, 1, 75, 1, 74, 2, 0, 2, 74, 330 - 2, 0, 2, 74, 1, 76, 4, 0, 1, 13, 7, 74, 1, 70, 2, 0, 331 - 1, 74, 11, 0, 2, 74, 15, 0, 1, 77, 1, 78, 37, 0, 4, 13, 332 - 2, 0, 3, 13, 1, 0, 1, 13, 2, 0, 1, 13, 2, 0, 1, 13, 333 - 1, 79, 2, 0, 2, 13, 5, 0, 2, 13, 1, 80, 5, 13, 1, 70, 334 - 2, 0, 1, 13, 11, 0, 2, 13, 20, 0, 1, 81, 58, 0, 1, 82, 335 - 27, 0, 4, 13, 2, 0, 3, 13, 1, 0, 1, 13, 2, 0, 1, 13, 336 - 2, 0, 1, 13, 1, 83, 2, 0, 2, 13, 5, 0, 8, 13, 1, 70, 337 - 2, 0, 1, 13, 11, 0, 2, 13, 13, 0, 1, 84, 44, 0, 1, 85, 338 - 1, 86, 8, 0, 1, 87, 1, 88, 3, 0, 1, 89, 5, 0, 1, 90, 339 - 1, 91, 1, 0, 1, 92, 9, 0, 1, 93, 1, 94, 1, 95, 1, 96, 340 - 1, 97, 1, 98, 34, 0, 1, 99, 16, 0, 1, 100, 10, 0, 1, 12, 341 - 1, 0, 1, 12, 23, 0, 1, 69, 1, 12, 1, 101, 24, 0, 3, 13, 342 - 1, 102, 2, 0, 3, 13, 1, 0, 1, 13, 2, 0, 1, 13, 2, 0, 343 - 2, 13, 2, 0, 2, 13, 5, 0, 8, 13, 1, 70, 2, 0, 1, 13, 344 - 11, 0, 2, 13, 1, 0, 4, 13, 2, 0, 3, 13, 1, 0, 1, 13, 345 - 2, 0, 1, 13, 2, 0, 2, 13, 2, 0, 2, 13, 5, 0, 5, 13, 346 - 1, 103, 2, 13, 1, 70, 2, 0, 1, 13, 11, 0, 2, 13, 1, 0, 347 - 4, 13, 2, 0, 3, 13, 1, 0, 1, 13, 2, 0, 1, 13, 2, 0, 348 - 2, 13, 2, 0, 2, 13, 5, 0, 5, 13, 1, 104, 2, 13, 1, 70, 349 - 2, 0, 1, 13, 11, 0, 2, 13, 36, 0, 1, 105, 57, 0, 1, 106, 350 - 53, 0, 1, 107, 1, 108, 35, 0, 1, 109, 16, 0, 1, 110, 35, 0, 351 - 1, 111, 15, 0, 1, 112, 1, 0, 1, 113, 56, 0, 1, 114, 4, 0, 352 - 8, 48, 1, 0, 1, 48, 2, 0, 1, 48, 2, 0, 38, 48, 8, 0, 353 - 1, 115, 4, 0, 1, 116, 1, 52, 2, 0, 1, 117, 10, 0, 1, 118, 354 - 1, 119, 1, 120, 1, 121, 1, 122, 1, 123, 1, 0, 1, 124, 5, 0, 355 - 1, 125, 9, 0, 1, 126, 1, 127, 8, 53, 1, 0, 1, 53, 2, 0, 356 - 1, 53, 2, 0, 38, 53, 8, 0, 1, 128, 4, 0, 1, 129, 1, 130, 357 - 2, 0, 1, 131, 10, 0, 1, 132, 1, 133, 1, 134, 1, 135, 1, 136, 358 - 1, 137, 1, 0, 1, 138, 5, 0, 1, 139, 9, 0, 1, 140, 1, 141, 359 - 2, 0, 1, 142, 1, 0, 1, 142, 2, 0, 2, 142, 5, 0, 1, 142, 360 - 2, 0, 2, 142, 2, 0, 2, 142, 1, 0, 1, 143, 4, 0, 7, 142, 361 - 3, 0, 1, 142, 11, 0, 2, 142, 13, 0, 1, 144, 52, 0, 1, 145, 362 - 41, 0, 1, 146, 1, 0, 1, 146, 2, 0, 2, 146, 5, 0, 1, 146, 363 - 2, 0, 2, 146, 2, 0, 2, 146, 1, 0, 1, 147, 4, 0, 7, 146, 364 - 3, 0, 1, 146, 11, 0, 2, 146, 1, 0, 4, 13, 2, 0, 3, 13, 365 - 1, 0, 1, 13, 2, 0, 1, 13, 2, 0, 2, 13, 2, 0, 2, 13, 366 - 5, 0, 2, 13, 1, 80, 5, 13, 1, 70, 2, 0, 1, 13, 11, 0, 367 - 2, 13, 13, 0, 1, 148, 40, 0, 2, 149, 1, 0, 1, 149, 1, 0, 368 - 1, 150, 1, 149, 1, 0, 1, 149, 1, 0, 1, 149, 2, 0, 1, 149, 369 - 2, 0, 2, 149, 2, 0, 2, 149, 5, 0, 8, 149, 3, 0, 1, 149, 370 - 3, 0, 1, 73, 7, 0, 2, 149, 5, 0, 1, 85, 1, 86, 8, 0, 371 - 1, 87, 1, 151, 3, 0, 1, 89, 5, 0, 1, 90, 1, 91, 1, 0, 372 - 1, 92, 9, 0, 1, 93, 1, 94, 1, 95, 1, 96, 1, 97, 1, 98, 373 - 9, 0, 1, 152, 26, 0, 1, 152, 60, 0, 1, 153, 17, 0, 4, 74, 374 - 2, 0, 3, 74, 1, 0, 1, 74, 2, 0, 1, 74, 2, 0, 2, 74, 375 - 2, 0, 2, 74, 5, 0, 8, 74, 1, 154, 2, 0, 1, 74, 11, 0, 376 - 2, 74, 10, 77, 2, 0, 41, 77, 16, 78, 1, 155, 36, 78, 1, 0, 377 - 4, 13, 2, 0, 3, 13, 1, 0, 1, 13, 2, 0, 1, 13, 2, 0, 378 - 2, 13, 2, 0, 2, 13, 5, 0, 3, 13, 1, 156, 4, 13, 1, 70, 379 - 2, 0, 1, 13, 11, 0, 2, 13, 10, 81, 2, 0, 41, 81, 1, 0, 380 - 3, 13, 1, 157, 2, 0, 3, 13, 1, 0, 1, 13, 2, 0, 1, 13, 381 - 2, 0, 2, 13, 2, 0, 2, 13, 5, 0, 8, 13, 1, 70, 2, 0, 382 - 1, 13, 11, 0, 2, 13, 5, 0, 1, 158, 19, 0, 1, 159, 33, 0, 383 - 1, 160, 18, 0, 1, 161, 1, 0, 1, 162, 50, 0, 1, 163, 52, 0, 384 - 1, 164, 53, 0, 1, 165, 52, 0, 1, 166, 68, 0, 1, 167, 1, 0, 385 - 1, 168, 26, 0, 1, 169, 52, 0, 1, 170, 59, 0, 1, 171, 52, 0, 386 - 1, 172, 52, 0, 1, 173, 17, 0, 1, 174, 34, 0, 1, 175, 1, 176, 387 - 51, 0, 1, 177, 1, 178, 15, 0, 1, 179, 11, 0, 2, 180, 1, 0, 388 - 1, 180, 16, 0, 1, 180, 6, 0, 1, 180, 3, 0, 2, 180, 17, 0, 389 - 1, 180, 2, 0, 4, 13, 2, 0, 3, 13, 1, 0, 1, 13, 2, 0, 390 - 1, 13, 2, 0, 2, 13, 2, 0, 2, 13, 5, 0, 4, 13, 1, 181, 391 - 3, 13, 1, 70, 2, 0, 1, 13, 11, 0, 2, 13, 1, 0, 4, 13, 392 - 2, 0, 3, 13, 1, 0, 1, 13, 2, 0, 1, 13, 2, 0, 2, 13, 393 - 2, 0, 2, 13, 5, 0, 6, 13, 1, 182, 1, 13, 1, 70, 2, 0, 394 - 1, 13, 11, 0, 2, 13, 1, 0, 4, 13, 2, 0, 3, 13, 1, 0, 395 - 1, 13, 2, 0, 1, 13, 2, 0, 2, 13, 2, 0, 2, 13, 5, 0, 396 - 2, 13, 1, 183, 5, 13, 1, 70, 2, 0, 1, 13, 11, 0, 2, 13, 397 - 1, 0, 2, 184, 1, 0, 1, 184, 16, 0, 1, 184, 6, 0, 1, 184, 398 - 3, 0, 2, 184, 17, 0, 1, 184, 2, 0, 2, 185, 1, 0, 1, 185, 399 - 16, 0, 1, 185, 6, 0, 1, 185, 3, 0, 2, 185, 17, 0, 1, 185, 400 - 2, 0, 2, 186, 1, 0, 1, 186, 16, 0, 1, 186, 6, 0, 1, 186, 401 - 3, 0, 2, 186, 17, 0, 1, 186, 2, 0, 2, 187, 1, 0, 1, 187, 402 - 16, 0, 1, 187, 6, 0, 1, 187, 3, 0, 2, 187, 17, 0, 1, 187, 403 - 2, 0, 4, 142, 2, 0, 3, 142, 1, 0, 1, 142, 2, 0, 1, 142, 404 - 2, 0, 2, 142, 2, 0, 2, 142, 5, 0, 8, 142, 3, 0, 1, 142, 405 - 1, 0, 1, 188, 9, 0, 2, 142, 1, 0, 4, 146, 2, 0, 3, 146, 406 - 1, 0, 1, 146, 2, 0, 1, 146, 2, 0, 2, 146, 2, 0, 2, 146, 407 - 5, 0, 8, 146, 3, 0, 1, 146, 1, 0, 1, 189, 9, 0, 2, 146, 408 - 1, 0, 2, 149, 1, 0, 1, 149, 1, 0, 2, 149, 1, 0, 1, 149, 409 - 1, 0, 1, 149, 2, 0, 1, 149, 2, 0, 2, 149, 2, 0, 2, 149, 410 - 3, 0, 1, 190, 1, 0, 8, 149, 3, 0, 1, 149, 11, 0, 2, 149, 411 - 1, 0, 2, 149, 1, 0, 1, 149, 2, 0, 1, 149, 1, 0, 1, 149, 412 - 1, 0, 1, 149, 2, 0, 1, 149, 2, 0, 2, 149, 2, 0, 2, 149, 413 - 5, 0, 8, 149, 3, 0, 1, 149, 11, 0, 2, 149, 25, 0, 1, 191, 414 - 28, 0, 1, 152, 1, 0, 1, 152, 1, 192, 22, 0, 1, 193, 1, 152, 415 - 60, 0, 1, 194, 16, 0, 15, 78, 1, 195, 1, 155, 36, 78, 1, 0, 416 - 3, 13, 1, 196, 2, 0, 3, 13, 1, 0, 1, 13, 2, 0, 1, 13, 417 - 2, 0, 2, 13, 2, 0, 2, 13, 5, 0, 8, 13, 1, 70, 2, 0, 418 - 1, 13, 11, 0, 2, 13, 1, 0, 4, 13, 2, 0, 3, 13, 1, 0, 419 - 1, 13, 2, 0, 1, 13, 2, 0, 2, 13, 2, 0, 1, 13, 1, 197, 420 - 5, 0, 8, 13, 1, 70, 2, 0, 1, 13, 11, 0, 2, 13, 25, 0, 421 - 1, 198, 52, 0, 1, 199, 52, 0, 1, 200, 52, 0, 1, 201, 52, 0, 422 - 1, 202, 70, 0, 1, 203, 51, 0, 1, 204, 40, 0, 1, 205, 43, 0, 423 - 1, 206, 56, 0, 1, 207, 1, 0, 1, 208, 50, 0, 1, 209, 52, 0, 424 - 1, 210, 52, 0, 1, 211, 1, 0, 1, 212, 26, 0, 4, 13, 2, 0, 425 - 3, 13, 1, 0, 1, 13, 2, 0, 1, 13, 2, 0, 2, 13, 2, 0, 426 - 1, 13, 1, 213, 5, 0, 8, 13, 1, 70, 2, 0, 1, 13, 11, 0, 427 - 2, 13, 1, 0, 2, 214, 1, 0, 1, 214, 16, 0, 1, 214, 6, 0, 428 - 1, 214, 3, 0, 2, 214, 17, 0, 1, 214, 2, 0, 2, 215, 1, 0, 429 - 1, 215, 16, 0, 1, 215, 6, 0, 1, 215, 3, 0, 2, 215, 17, 0, 430 - 1, 215, 2, 0, 2, 216, 1, 0, 1, 216, 16, 0, 1, 216, 6, 0, 431 - 1, 216, 3, 0, 2, 216, 17, 0, 1, 216, 2, 0, 2, 217, 1, 0, 432 - 1, 217, 16, 0, 1, 217, 6, 0, 1, 217, 3, 0, 2, 217, 17, 0, 433 - 1, 217, 2, 0, 1, 218, 3, 0, 2, 219, 21, 0, 1, 218, 25, 0, 434 - 1, 220, 26, 0, 1, 220, 49, 0, 1, 221, 52, 0, 1, 222, 52, 0, 435 - 1, 223, 52, 0, 1, 224, 52, 0, 1, 225, 52, 0, 1, 226, 28, 0, 436 - 3, 13, 1, 227, 2, 0, 3, 13, 1, 0, 1, 13, 2, 0, 1, 13, 437 - 2, 0, 2, 13, 2, 0, 2, 13, 5, 0, 8, 13, 1, 70, 2, 0, 438 - 1, 13, 11, 0, 2, 13, 1, 0, 2, 228, 1, 0, 1, 228, 16, 0, 439 - 1, 228, 6, 0, 1, 228, 3, 0, 2, 228, 17, 0, 1, 228, 2, 0, 440 - 2, 229, 1, 0, 1, 229, 16, 0, 1, 229, 6, 0, 1, 229, 3, 0, 441 - 2, 229, 17, 0, 1, 229, 2, 0, 2, 230, 1, 0, 1, 230, 16, 0, 442 - 1, 230, 6, 0, 1, 230, 3, 0, 2, 230, 17, 0, 1, 230, 2, 0, 443 - 2, 231, 1, 0, 1, 231, 16, 0, 1, 231, 6, 0, 1, 231, 3, 0, 444 - 2, 231, 17, 0, 1, 231, 2, 0, 1, 218, 1, 0, 1, 218, 24, 0, 445 - 1, 218, 25, 0, 1, 218, 26, 0, 1, 218, 25, 0, 1, 220, 1, 0, 446 - 1, 220, 23, 0, 1, 232, 1, 220, 25, 0, 2, 233, 1, 0, 1, 233, 447 - 16, 0, 1, 233, 6, 0, 1, 233, 3, 0, 2, 233, 17, 0, 1, 233, 448 - 2, 0, 2, 234, 1, 0, 1, 234, 16, 0, 1, 234, 6, 0, 1, 234, 449 - 3, 0, 2, 234, 17, 0, 1, 234, 2, 0, 2, 235, 1, 0, 1, 235, 450 - 16, 0, 1, 235, 6, 0, 1, 235, 3, 0, 2, 235, 17, 0, 1, 235, 451 - 2, 0, 2, 236, 1, 0, 1, 236, 16, 0, 1, 236, 6, 0, 1, 236, 452 - 3, 0, 2, 236, 17, 0, 1, 236, 2, 0, 1, 237, 26, 0, 1, 237, 453 - 25, 0, 2, 238, 1, 0, 1, 238, 16, 0, 1, 238, 6, 0, 1, 238, 454 - 3, 0, 2, 238, 17, 0, 1, 238, 2, 0, 2, 239, 1, 0, 1, 239, 455 - 16, 0, 1, 239, 6, 0, 1, 239, 3, 0, 2, 239, 17, 0, 1, 239, 456 - 2, 0, 1, 237, 1, 0, 1, 237, 24, 0, 1, 237, 25, 0, 2, 240, 457 - 1, 0, 1, 240, 16, 0, 1, 240, 6, 0, 1, 240, 3, 0, 2, 240, 458 - 17, 0, 1, 240, 2, 0, 2, 241, 1, 0, 1, 241, 16, 0, 1, 241, 459 - 6, 0, 1, 241, 3, 0, 2, 241, 17, 0, 1, 241, 2, 0, 2, 242, 460 - 1, 0, 1, 242, 16, 0, 1, 242, 6, 0, 1, 242, 3, 0, 2, 242, 461 - 17, 0, 1, 242, 2, 0, 2, 243, 1, 0, 1, 243, 16, 0, 1, 243, 462 - 6, 0, 1, 243, 3, 0, 2, 243, 17, 0, 1, 243, 1, 0, 0, 463 - ]; 464 - 465 - private static int [] zzUnpackTrans() { 466 - int [] result = new int[7049]; 467 - int offset = 0; 468 - offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); 469 - return result; 470 - } 471 - 472 - private static int zzUnpackTrans(ushort[] packed, int offset, int [] result) { 473 - int i = 0; /* index in packed string */ 474 - int j = offset; /* index in unpacked array */ 475 - int l = packed.Length; 476 - while (i + 1 < l) { 477 - int count = packed[i++]; 478 - int value = packed[i++]; 479 - value--; 480 - do result[j++] = value; while (--count > 0); 481 - } 482 - return j; 483 - } 484 - 485 - 486 - /* error codes */ 487 - private const int ZZ_UNKNOWN_ERROR = 0; 488 - private const int ZZ_NO_MATCH = 1; 489 - private const int ZZ_PUSHBACK_2BIG = 2; 490 - 491 - /* error messages for the codes above */ 492 - private static readonly String[] ZZ_ERROR_MSG = [ 493 - "Unkown internal scanner error", 494 - "Error: could not match input", 495 - "Error: pushback value was too large", 496 - ]; 497 - 498 - /** 499 - * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code> 500 - */ 501 - private static readonly int [] ZZ_ATTRIBUTE; 502 - 503 - private static readonly ushort[] ZZ_ATTRIBUTE_PACKED_0 = [ 504 - 10, 0, 1, 9, 5, 1, 1, 9, 2, 1, 1, 9, 6, 1, 1, 9, 505 - 1, 1, 1, 9, 5, 1, 3, 9, 4, 1, 3, 9, 1, 1, 2, 9, 506 - 2, 1, 3, 9, 2, 1, 2, 9, 1, 1, 1, 9, 1, 1, 2, 9, 507 - 2, 1, 1, 9, 4, 1, 2, 0, 3, 9, 1, 1, 2, 9, 1, 1, 508 - 1, 0, 3, 1, 1, 9, 1, 1, 1, 9, 14, 0, 2, 9, 1, 0, 509 - 3, 1, 14, 9, 1, 0, 1, 9, 1, 0, 11, 9, 1, 0, 1, 9, 510 - 1, 0, 6, 9, 1, 1, 3, 9, 1, 1, 2, 9, 2, 1, 1, 0, 511 - 1, 1, 1, 9, 2, 0, 2, 1, 1, 0, 1, 9, 1, 0, 1, 9, 512 - 1, 0, 2, 9, 6, 0, 3, 9, 1, 0, 1, 9, 1, 0, 1, 9, 513 - 2, 0, 5, 1, 1, 0, 1, 1, 1, 0, 4, 9, 2, 0, 2, 9, 514 - 2, 1, 5, 9, 4, 0, 1, 9, 1, 0, 3, 9, 1, 0, 2, 1, 515 - 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 6, 9, 2, 1, 516 - 1, 0, 1, 1, 2, 0, 1, 9, 1, 1, 1, 9, 2, 1, 6, 0, 0, 517 - ]; 518 - 519 - private static int [] zzUnpackAttribute() { 520 - int [] result = new int[243]; 521 - int offset = 0; 522 - offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); 523 - return result; 524 - } 525 - 526 - private static int zzUnpackAttribute(ushort[] packed, int offset, int [] result) { 527 - int i = 0; /* index in packed string */ 528 - int j = offset; /* index in unpacked array */ 529 - int l = packed.Length; 530 - while (i + 1 < l) { 531 - int count = packed[i++]; 532 - int value = packed[i++]; 533 - do result[j++] = value; while (--count > 0); 534 - } 535 - return j; 536 - } 537 - 538 - /** the input device */ 539 - private System.IO.TextReader zzReader; 540 - 541 - /** the current state of the DFA */ 542 - private int zzState; 543 - 544 - /** the current lexical state */ 545 - private int zzLexicalState = YYINITIAL; 546 - 547 - /** this buffer contains the current text to be matched and is 548 - the source of the yytext() string */ 549 - private char[] zzBuffer = new char[ZZ_BUFFERSIZE]; 550 - 551 - /** the textposition at the last accepting state */ 552 - private int zzMarkedPos; 553 - 554 - /** the textposition at the last state to be included in yytext */ 555 - private int zzPushbackPos; 556 - 557 - /** the current text position in the buffer */ 558 - private int zzCurrentPos; 559 - 560 - /** startRead marks the beginning of the yytext() string in the buffer */ 561 - private int zzStartRead; 562 - 563 - /** endRead marks the last character in the buffer, that has been read 564 - from input */ 565 - private int zzEndRead; 566 - 567 - /** number of newlines encountered up to the start of the matched text */ 568 - private int yyline; 569 - 570 - /** the number of characters up to the start of the matched text */ 571 - private int yychar; 572 - 573 - /** 574 - * the number of characters from the last newline up to the start of the 575 - * matched text 576 - */ 577 - private int yycolumn; 578 - 579 - /** 580 - * zzAtBOL == true <=> the scanner is currently at the beginning of a line 581 - */ 582 - private bool zzAtBOL = true; 583 - 584 - /** zzAtEOF == true <=> the scanner is at the EOF */ 585 - private bool zzAtEOF; 586 - 587 - 588 - /** the stack of open (nested) input streams to read from */ 589 - private System.Collections.Stack zzStreams = new System.Collections.Stack(); 590 - 591 - /** 592 - * inner class used to store info for nested 593 - * input streams 594 - */ 595 - private sealed class ZzFlexStreamInfo { 596 - public System.IO.TextReader zzReader; 597 - public int zzEndRead; 598 - public int zzStartRead; 599 - public int zzCurrentPos; 600 - public int zzMarkedPos; 601 - public int zzPushbackPos; 602 - public int yyline; 603 - public int yycolumn; 604 - public char [] zzBuffer; 605 - public bool zzAtEOF; 606 - 607 - /** sets all values stored in this class */ 608 - public ZzFlexStreamInfo(System.IO.TextReader zzReader, int zzEndRead, int zzStartRead, 609 - int zzCurrentPos, int zzMarkedPos, int zzPushbackPos, 610 - char [] zzBuffer, bool zzAtEOF, int yyline, int yycolumn) { 611 - this.zzReader = zzReader; 612 - this.zzEndRead = zzEndRead; 613 - this.zzStartRead = zzStartRead; 614 - this.zzCurrentPos = zzCurrentPos; 615 - this.zzMarkedPos = zzMarkedPos; 616 - this.zzPushbackPos = zzPushbackPos; 617 - this.zzBuffer = zzBuffer; 618 - this.zzAtEOF = zzAtEOF; 619 - this.yyline = yyline; 620 - this.yycolumn = yycolumn; 621 - } 622 - } 623 - 624 - 625 - /** 626 - * Creates a new scanner 627 - * There is also a System.IO.Stream version of this constructor. 628 - * 629 - * @param in the System.IO.TextReader to read input from. 630 - */ 631 - internal Lexer(TextReader @in) { 632 - this.zzReader = @in; 633 - } 634 - 635 - /** 636 - * Creates a new scanner. 637 - * There is also TextReader version of this constructor. 638 - * 639 - * @param in the System.IO.Stream to read input from. 640 - */ 641 - internal Lexer(Stream @in) : this(new StreamReader(@in)) 642 - { 643 - } 644 - 645 - /** 646 - * Unpacks the compressed character translation table. 647 - * 648 - * @param packed the packed character translation table 649 - * @return the unpacked character translation table 650 - */ 651 - private static char [] zzUnpackCMap(ushort[] packed) { 652 - char [] map = new char[0x10000]; 653 - int i = 0; /* index in packed string */ 654 - int j = 0; /* index in unpacked array */ 655 - while (i < 1594) { 656 - int count = packed[i++]; 657 - char value = (char)packed[i++]; 658 - do map[j++] = value; while (--count > 0); 659 - } 660 - return map; 661 - } 662 - 663 - 664 - /** 665 - * Refills the input buffer. 666 - * 667 - * @return <code>false</code>, iff there was new input. 668 - * 669 - * @exception System.IO.IOException if any I/O-Error occurs 670 - */ 671 - private bool zzRefill() { 672 - 673 - /* first: make room (if you can) */ 674 - if (zzStartRead > 0) { 675 - Array.Copy(zzBuffer, zzStartRead, 676 - zzBuffer, 0, 677 - zzEndRead-zzStartRead); 678 - 679 - /* translate stored positions */ 680 - zzEndRead-= zzStartRead; 681 - zzCurrentPos-= zzStartRead; 682 - zzMarkedPos-= zzStartRead; 683 - zzPushbackPos-= zzStartRead; 684 - zzStartRead = 0; 685 - } 686 - 687 - /* is the buffer big enough? */ 688 - if (zzCurrentPos >= zzBuffer.Length) { 689 - /* if not: blow it up */ 690 - char[] newBuffer = new char[zzCurrentPos*2]; 691 - Array.Copy(zzBuffer, 0, newBuffer, 0, zzBuffer.Length); 692 - zzBuffer = newBuffer; 693 - } 694 - 695 - /* finally: fill the buffer with new input */ 696 - int numRead = zzReader.Read(zzBuffer, zzEndRead, 697 - zzBuffer.Length-zzEndRead); 698 - 699 - if (numRead <= 0) { 700 - return true; 701 - } 702 - else { 703 - zzEndRead+= numRead; 704 - return false; 705 - } 706 - } 707 - 708 - 709 - /** 710 - * Closes the input stream. 711 - */ 712 - public void yyclose() { 713 - zzAtEOF = true; /* indicate end of file */ 714 - zzEndRead = zzStartRead; /* invalidate buffer */ 715 - 716 - if (zzReader != null) 717 - zzReader.Close(); 718 - } 719 - 720 - 721 - /** 722 - * Stores the current input stream on a stack, and 723 - * reads from a new stream. Lexical state, line, 724 - * char, and column counting remain untouched. 725 - * 726 - * The current input stream can be restored with 727 - * yypopstream (usually in an <<EOF>> action). 728 - * 729 - * @param reader the new input stream to read from 730 - * 731 - * @see #yypopStream() 732 - */ 733 - public void yypushStream(TextReader reader) { 734 - zzStreams.Push( 735 - new ZzFlexStreamInfo(zzReader, zzEndRead, zzStartRead, zzCurrentPos, 736 - zzMarkedPos, zzPushbackPos, zzBuffer, zzAtEOF, 737 - yyline, yycolumn) 738 - ); 739 - zzAtEOF = false; 740 - zzBuffer = new char[ZZ_BUFFERSIZE]; 741 - zzReader = reader; 742 - zzEndRead = zzStartRead = 0; 743 - zzCurrentPos = zzMarkedPos = zzPushbackPos = 0; 744 - yyline = yycolumn = 0; 745 - } 746 - 747 - 748 - /** 749 - * Closes the current input stream and continues to 750 - * read from the one on top of the stream stack. 751 - * 752 - * @throws System.InvalidOperationException 753 - * if there is no further stream to read from. 754 - * 755 - * @throws System.IO.IOException 756 - * if there was an error in closing the stream. 757 - * 758 - * @see #yypushStream(TextReader) 759 - */ 760 - public void yypopStream() { 761 - zzReader.Close(); 762 - ZzFlexStreamInfo s = (ZzFlexStreamInfo) zzStreams.Pop(); 763 - zzBuffer = s.zzBuffer; 764 - zzReader = s.zzReader; 765 - zzEndRead = s.zzEndRead; 766 - zzStartRead = s.zzStartRead; 767 - zzCurrentPos = s.zzCurrentPos; 768 - zzMarkedPos = s.zzMarkedPos ; 769 - zzPushbackPos = s.zzPushbackPos; 770 - zzAtEOF = s.zzAtEOF; 771 - yyline = s.yyline; 772 - yycolumn = s.yycolumn; 773 - } 774 - 775 - 776 - /** 777 - * Returns true iff there are still streams left 778 - * to read from on the stream stack. 779 - */ 780 - public bool yymoreStreams() { 781 - return zzStreams.Count != 0; 782 - } 783 - 784 - 785 - /** 786 - * Resets the scanner to read from a new input stream. 787 - * Does not close the old reader. 788 - * 789 - * All internal variables are reset, the old input stream 790 - * <b>cannot</b> be reused (internal buffer is discarded and lost). 791 - * Lexical state is set to <tt>ZZ_INITIAL</tt>. 792 - * 793 - * @param reader the new input stream 794 - * 795 - * @see #yypushStream(System.IO.TextReader) 796 - * @see #yypopStream() 797 - */ 798 - public void yyreset(System.IO.TextReader reader) { 799 - zzReader = reader; 800 - zzAtBOL = true; 801 - zzAtEOF = false; 802 - zzEndRead = zzStartRead = 0; 803 - zzCurrentPos = zzMarkedPos = zzPushbackPos = 0; 804 - yyline = yychar = yycolumn = 0; 805 - zzLexicalState = YYINITIAL; 806 - } 807 - 808 - 809 - /** 810 - * Returns the current lexical state. 811 - */ 812 - public int yystate() { 813 - return zzLexicalState; 814 - } 815 - 816 - 817 - /** 818 - * Enters a new lexical state 819 - * 820 - * @param newState the new lexical state 821 - */ 822 - public void yybegin(int newState) { 823 - zzLexicalState = newState; 824 - } 825 - 826 - 827 - /** 828 - * Returns the text matched by the current regular expression. 829 - */ 830 - public String yytext() { 831 - return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); 832 - } 833 - 834 - 835 - /** 836 - * Returns the character at position <tt>pos</tt> from the 837 - * matched text. 838 - * 839 - * It is equivalent to yytext().charAt(pos), but faster 840 - * 841 - * @param pos the position of the character to fetch. 842 - * A value from 0 to yylength()-1. 843 - * 844 - * @return the character at position pos 845 - */ 846 - public char yycharat(int pos) { 847 - return zzBuffer[zzStartRead+pos]; 848 - } 849 - 850 - 851 - /** 852 - * Returns the length of the matched text region. 853 - */ 854 - public int yylength() { 855 - return zzMarkedPos-zzStartRead; 856 - } 857 - 858 - 859 - /** 860 - * Reports an error that occured while scanning. 861 - * 862 - * In a wellformed scanner (no or only correct usage of 863 - * yypushback(int) and a match-all fallback rule) this method 864 - * will only be called with things that "Can't Possibly Happen". 865 - * If this method is called, something is seriously wrong 866 - * (e.g. a JFlex/CSFlex bug producing a faulty scanner etc.). 867 - * 868 - * Usual syntax/scanner level error handling should be done 869 - * in error fallback rules. 870 - * 871 - * @param errorCode the code of the errormessage to display 872 - */ 873 - private void zzScanError(int errorCode) { 874 - String message; 875 - try { 876 - message = ZZ_ERROR_MSG[errorCode]; 877 - } 878 - catch (IndexOutOfRangeException) { 879 - message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; 880 - } 881 - 882 - throw new Exception(message); 883 - } 884 - 885 - 886 - /** 887 - * Pushes the specified amount of characters back into the input stream. 888 - * 889 - * They will be read again by then next call of the scanning method 890 - * 891 - * @param number the number of characters to be read again. 892 - * This number must not be greater than yylength()! 893 - */ 894 - public void yypushback(int number) { 895 - if ( number > yylength() ) 896 - zzScanError(ZZ_PUSHBACK_2BIG); 897 - 898 - zzMarkedPos -= number; 899 - } 900 - 901 - 902 - /** 903 - * Resumes scanning until the next regular expression is matched, 904 - * the end of input is encountered or an I/O-Error occurs. 905 - * 906 - * @return the next token 907 - * @exception System.IO.IOException if any I/O-Error occurs 908 - */ 909 - public Token Scan() { 910 - int zzInput = 0; 911 - int zzAction; 912 - 913 - int [] zzTransL = ZZ_TRANS; 914 - int [] zzRowMapL = ZZ_ROWMAP; 915 - int [] zzAttrL = ZZ_ATTRIBUTE; 916 - 917 - while (true) { 918 - // cached fields: 919 - int zzCurrentPosL; 920 - int zzMarkedPosL = zzMarkedPos; 921 - int zzEndReadL = zzEndRead; 922 - char [] zzBufferL = zzBuffer; 923 - char [] zzCMapL = ZZ_CMAP; 924 - 925 - yychar+= zzMarkedPosL-zzStartRead; 926 - 927 - bool zzR = false; 928 - for (zzCurrentPosL = zzStartRead; zzCurrentPosL < zzMarkedPosL; 929 - zzCurrentPosL++) { 930 - switch (zzBufferL[zzCurrentPosL]) { 931 - case '\u000B': 932 - case '\u000C': 933 - case '\u0085': 934 - case '\u2028': 935 - case '\u2029': 936 - yyline++; 937 - yycolumn = 0; 938 - zzR = false; 939 - break; 940 - case '\r': 941 - yyline++; 942 - yycolumn = 0; 943 - zzR = true; 944 - break; 945 - case '\n': 946 - if (zzR) 947 - zzR = false; 948 - else { 949 - yyline++; 950 - yycolumn = 0; 951 - } 952 - break; 953 - default: 954 - zzR = false; 955 - yycolumn++; 956 - break; 957 - } 958 - } 959 - 960 - if (zzR) { 961 - // peek one character ahead if it is \n (if we have counted one line too much) 962 - bool zzPeek; 963 - if (zzMarkedPosL < zzEndReadL) 964 - zzPeek = zzBufferL[zzMarkedPosL] == '\n'; 965 - else if (zzAtEOF) 966 - zzPeek = false; 967 - else { 968 - bool eof = zzRefill(); 969 - zzMarkedPosL = zzMarkedPos; 970 - zzBufferL = zzBuffer; 971 - if (eof) 972 - zzPeek = false; 973 - else 974 - zzPeek = zzBufferL[zzMarkedPosL] == '\n'; 975 - } 976 - if (zzPeek) yyline--; 977 - } 978 - zzAction = -1; 979 - 980 - zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; 981 - 982 - zzState = zzLexicalState; 983 - 984 - 985 - while (true) { 986 - goto zzForAction_skip; 987 - zzForAction: break; 988 - zzForAction_skip: 989 - if (!ZZ_SPURIOUS_WARNINGS_SUCK) goto zzForAction; 990 - 991 - if (zzCurrentPosL < zzEndReadL) 992 - zzInput = zzBufferL[zzCurrentPosL++]; 993 - else if (zzAtEOF) { 994 - zzInput = YYEOF; 995 - goto zzForAction; 996 - } 997 - else { 998 - // store back cached positions 999 - zzCurrentPos = zzCurrentPosL; 1000 - zzMarkedPos = zzMarkedPosL; 1001 - bool eof = zzRefill(); 1002 - // get translated positions and possibly new buffer 1003 - zzCurrentPosL = zzCurrentPos; 1004 - zzMarkedPosL = zzMarkedPos; 1005 - zzBufferL = zzBuffer; 1006 - zzEndReadL = zzEndRead; 1007 - if (eof) { 1008 - zzInput = YYEOF; 1009 - goto zzForAction; 1010 - } 1011 - else { 1012 - zzInput = zzBufferL[zzCurrentPosL++]; 1013 - } 1014 - } 1015 - int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; 1016 - if (zzNext == -1) goto zzForAction; 1017 - zzState = zzNext; 1018 - 1019 - int zzAttributes = zzAttrL[zzState]; 1020 - if ( (zzAttributes & 1) == 1 ) { 1021 - zzAction = zzState; 1022 - zzMarkedPosL = zzCurrentPosL; 1023 - if ( (zzAttributes & 8) == 8 ) goto zzForAction; 1024 - } 1025 - 1026 - } 1027 - 1028 - // store back cached position 1029 - zzMarkedPos = zzMarkedPosL; 1030 - 1031 - switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { 1032 - case 93: 1033 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1034 - { 1035 - #line 350 "Prexonite.lex" 1036 - string fragment = buffer.ToString(); 1037 - buffer.Length = 0; 1038 - PushState(_surroundingLocalState); 1039 - return multiple( 1040 - tok(Parser._string, fragment), 1041 - tok(Parser._plus), 1042 - tok(Parser._LPopExpr), 1043 - tok(Parser._lpar) 1044 - //2nd plus is injected by the parser 1045 - ); 1046 - 1047 - #line default 1048 - } 1049 - break; 1050 - case 12: 1051 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1052 - { 1053 - #line 203 "Prexonite.lex" 1054 - return tok(Parser._lpar); 1055 - #line default 1056 - } 1057 - break; 1058 - case 13: 1059 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1060 - { 1061 - #line 204 "Prexonite.lex" 1062 - return tok(Parser._rpar); 1063 - #line default 1064 - } 1065 - break; 1066 - case 46: 1067 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1068 - { 1069 - #line 169 "Prexonite.lex" 1070 - return tok(Parser._id, yytext().Substring(1)); 1071 - #line default 1072 - } 1073 - break; 1074 - case 109: 1075 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1076 - { 1077 - #line 264 "Prexonite.lex" 1078 - buffer.Append(_unescapeChar(yytext())); 1079 - #line default 1080 - } 1081 - break; 1082 - case 89: 1083 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1084 - { 1085 - #line 304 "Prexonite.lex" 1086 - string fragment = buffer.ToString(); 1087 - buffer.Length = 0; 1088 - PushState(_surroundingLocalState); 1089 - return multiple( 1090 - tok(Parser._string, fragment), 1091 - tok(Parser._plus), 1092 - tok(Parser._LPopExpr), 1093 - tok(Parser._lpar) 1094 - //2nd plus is injected by the parser 1095 - ); 1096 - 1097 - #line default 1098 - } 1099 - break; 1100 - case 84: 1101 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1102 - { 1103 - #line 284 "Prexonite.lex" 1104 - buffer.Append("\v"); 1105 - #line default 1106 - } 1107 - break; 1108 - case 116: 1109 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1110 - { 1111 - #line 196 "Prexonite.lex" 1112 - return tok(Parser._id,OperatorNames.Prexonite.Decrement); 1113 - #line default 1114 - } 1115 - break; 1116 - case 32: 1117 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1118 - { 1119 - #line 246 "Prexonite.lex" 1120 - PopState(); 1121 - ret(tok(Parser._string, buffer.ToString())); 1122 - buffer.Length = 0; 1123 - 1124 - #line default 1125 - } 1126 - break; 1127 - case 127: 1128 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1129 - { 1130 - #line 198 "Prexonite.lex" 1131 - return tok(Parser._id,OperatorNames.Prexonite.UnaryDeltaLeftPost); 1132 - #line default 1133 - } 1134 - break; 1135 - case 30: 1136 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1137 - { 1138 - #line 250 "Prexonite.lex" 1139 - buffer.Append(yytext()); 1140 - #line default 1141 - } 1142 - break; 1143 - case 94: 1144 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1145 - { 1146 - #line 113 "Prexonite.lex" 1147 - buffer.Length = 0; PushState(SmartVerbatimString); 1148 - #line default 1149 - } 1150 - break; 1151 - case 31: 1152 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1153 - { 1154 - #line 365 "Prexonite.lex" 1155 - throw new PrexoniteException(System.String.Format("Invalid character \"{0}\" detected on line {1} in {2}.", yytext(), yyline, File)); 1156 - #line default 1157 - } 1158 - break; 1159 - case 17: 1160 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1161 - { 1162 - #line 177 "Prexonite.lex" 1163 - return tok(Parser._lbrace); 1164 - #line default 1165 - } 1166 - break; 1167 - case 7: 1168 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1169 - { 1170 - #line 106 "Prexonite.lex" 1171 - buffer.Length = 0; PushState(String); 1172 - #line default 1173 - } 1174 - break; 1175 - case 81: 1176 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1177 - { 1178 - #line 283 "Prexonite.lex" 1179 - buffer.Append("\r"); 1180 - #line default 1181 - } 1182 - break; 1183 - case 90: 1184 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1185 - { 1186 - #line 324 "Prexonite.lex" 1187 - buffer.Append("\""); 1188 - #line default 1189 - } 1190 - break; 1191 - case 18: 1192 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1193 - { 1194 - #line 178 "Prexonite.lex" 1195 - return tok(Parser._lbrack); 1196 - #line default 1197 - } 1198 - break; 1199 - case 121: 1200 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1201 - { 1202 - #line 191 "Prexonite.lex" 1203 - return tok(Parser._id,OperatorNames.Prexonite.GreaterThanOrEqual); 1204 - #line default 1205 - } 1206 - break; 1207 - case 79: 1208 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1209 - { 1210 - #line 285 "Prexonite.lex" 1211 - buffer.Append("\t"); 1212 - #line default 1213 - } 1214 - break; 1215 - case 42: 1216 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1217 - { 1218 - #line 112 "Prexonite.lex" 1219 - buffer.Length = 0; PushState(SmartString); 1220 - #line default 1221 - } 1222 - break; 1223 - case 9: 1224 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1225 - { 1226 - #line 209 "Prexonite.lex" 1227 - return tok(Parser._times); 1228 - #line default 1229 - } 1230 - break; 1231 - case 114: 1232 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1233 - { 1234 - #line 101 "Prexonite.lex" 1235 - return tok(Parser._does); 1236 - #line default 1237 - } 1238 - break; 1239 - case 112: 1240 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1241 - { 1242 - #line 161 "Prexonite.lex" 1243 - string ns = yytext(); 1244 - return tok(Parser._ns, ns.Substring(1,ns.Length-3)); 1245 - #line default 1246 - } 1247 - break; 1248 - case 14: 1249 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1250 - { 1251 - #line 212 "Prexonite.lex" 1252 - return tok(Parser._assign); 1253 - #line default 1254 - } 1255 - break; 1256 - case 27: 1257 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1258 - { 1259 - #line 230 "Prexonite.lex" 1260 - return tok(Parser._question); 1261 - #line default 1262 - } 1263 - break; 1264 - case 86: 1265 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1266 - { 1267 - #line 280 "Prexonite.lex" 1268 - buffer.Append("\b"); 1269 - #line default 1270 - } 1271 - break; 1272 - case 83: 1273 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1274 - { 1275 - #line 279 "Prexonite.lex" 1276 - buffer.Append("\a"); 1277 - #line default 1278 - } 1279 - break; 1280 - case 82: 1281 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1282 - { 1283 - #line 281 "Prexonite.lex" 1284 - buffer.Append("\f"); 1285 - #line default 1286 - } 1287 - break; 1288 - case 73: 1289 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1290 - { 1291 - #line 253 "Prexonite.lex" 1292 - /* nothing to do */ 1293 - #line default 1294 - } 1295 - break; 1296 - case 8: 1297 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1298 - { 1299 - #line 210 "Prexonite.lex" 1300 - return tok(Parser._div); 1301 - #line default 1302 - } 1303 - break; 1304 - case 43: 1305 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1306 - { 1307 - #line 225 "Prexonite.lex" 1308 - return tok(Parser._inc); 1309 - #line default 1310 - } 1311 - break; 1312 - case 21: 1313 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1314 - { 1315 - #line 217 "Prexonite.lex" 1316 - return tok(Parser._bitOr); 1317 - #line default 1318 - } 1319 - break; 1320 - case 87: 1321 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1322 - { 1323 - #line 282 "Prexonite.lex" 1324 - buffer.Append("\n"); 1325 - #line default 1326 - } 1327 - break; 1328 - case 123: 1329 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1330 - { 1331 - #line 201 "Prexonite.lex" 1332 - return tok(Parser._id,OperatorNames.Prexonite.BinaryDeltaLeft); 1333 - #line default 1334 - } 1335 - break; 1336 - case 25: 1337 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1338 - { 1339 - #line 206 "Prexonite.lex" 1340 - return tok(Parser._rbrace); 1341 - #line default 1342 - } 1343 - break; 1344 - case 128: 1345 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1346 - { 1347 - #line 187 "Prexonite.lex" 1348 - return tok(Parser._id,OperatorNames.Prexonite.ExclusiveOr); 1349 - #line default 1350 - } 1351 - break; 1352 - case 58: 1353 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1354 - { 1355 - #line 214 "Prexonite.lex" 1356 - return tok(Parser._deltaright); 1357 - #line default 1358 - } 1359 - break; 1360 - case 108: 1361 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1362 - { 1363 - #line 158 "Prexonite.lex" 1364 - return tok(Parser._var); 1365 - #line default 1366 - } 1367 - break; 1368 - case 24: 1369 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1370 - { 1371 - #line 205 "Prexonite.lex" 1372 - return tok(Parser._rbrack); 1373 - #line default 1374 - } 1375 - break; 1376 - case 6: 1377 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1378 - { 1379 - #line 147 "Prexonite.lex" 1380 - /* Comment/Whitespace: ignore */ 1381 - #line default 1382 - } 1383 - break; 1384 - case 1: 1385 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1386 - { 1387 - #line 242 "Prexonite.lex" 1388 - throw new PrexoniteException(System.String.Format("Invalid character \"{0}\" detected on line {1} in {2}.", yytext(), yyline, File)); 1389 - #line default 1390 - } 1391 - break; 1392 - case 26: 1393 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1394 - { 1395 - #line 227 "Prexonite.lex" 1396 - return tok(Parser._tilde); 1397 - #line default 1398 - } 1399 - break; 1400 - case 95: 1401 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1402 - { 1403 - #line 130 "Prexonite.lex" 1404 - 1405 - String flag = yytext(); 1406 - if(flag.EndsWith("=")) { 1407 - return multiple( 1408 - tok(Parser._string, flag), 1409 - tok(Parser._plus, "+") 1410 - ); 1411 - } 1412 - else { 1413 - return tok(Parser._string, flag); 1414 - } 1415 - 1416 - #line default 1417 - } 1418 - break; 1419 - case 65: 1420 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1421 - { 1422 - #line 251 "Prexonite.lex" 1423 - buffer.Append("\\"); 1424 - #line default 1425 - } 1426 - break; 1427 - case 48: 1428 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1429 - { 1430 - #line 172 "Prexonite.lex" 1431 - return multiple(tok(Parser._var), tok(Parser._id, PFunction.ArgumentListId)); 1432 - #line default 1433 - } 1434 - break; 1435 - case 115: 1436 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1437 - { 1438 - #line 195 "Prexonite.lex" 1439 - return tok(Parser._id,OperatorNames.Prexonite.Increment); 1440 - #line default 1441 - } 1442 - break; 1443 - case 2: 1444 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1445 - { 1446 - #line 154 "Prexonite.lex" 1447 - return tok(Parser._integer, yytext()); 1448 - #line default 1449 - } 1450 - break; 1451 - case 88: 1452 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1453 - { 1454 - #line 291 "Prexonite.lex" 1455 - string clipped; 1456 - string id = _pruneSmartStringIdentifier(yytext(), out clipped); 1457 - string fragment = buffer.ToString(); 1458 - buffer.Length = 0; 1459 - return multiple( 1460 - tok(Parser._string, fragment), 1461 - tok(Parser._plus), 1462 - tok(Parser._id, id), 1463 - clipped != null ? tok(Parser._plus) : null, 1464 - clipped != null ? tok(Parser._string, clipped) : null, 1465 - tok(Parser._plus) 1466 - ); 1467 - 1468 - #line default 1469 - } 1470 - break; 1471 - case 55: 1472 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1473 - { 1474 - #line 228 "Prexonite.lex" 1475 - return tok(Parser._doublecolon); 1476 - #line default 1477 - } 1478 - break; 1479 - case 34: 1480 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1481 - { 1482 - #line 274 "Prexonite.lex" 1483 - buffer.Append(yytext()); 1484 - #line default 1485 - } 1486 - break; 1487 - case 41: 1488 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1489 - { 1490 - #line 330 "Prexonite.lex" 1491 - PopState(); 1492 - ret(tok(Parser._string, buffer.ToString())); 1493 - buffer.Length = 0; 1494 - 1495 - #line default 1496 - } 1497 - break; 1498 - case 60: 1499 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1500 - { 1501 - #line 238 "Prexonite.lex" 1502 - return tok(Parser._appendright); 1503 - #line default 1504 - } 1505 - break; 1506 - case 68: 1507 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1508 - { 1509 - #line 254 "Prexonite.lex" 1510 - buffer.Append("\0"); 1511 - #line default 1512 - } 1513 - break; 1514 - case 57: 1515 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1516 - { 1517 - #line 216 "Prexonite.lex" 1518 - return tok(Parser._or); 1519 - #line default 1520 - } 1521 - break; 1522 - case 96: 1523 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1524 - { 1525 - #line 150 "Prexonite.lex" 1526 - return tok(Parser._realLike, yytext()); 1527 - #line default 1528 - } 1529 - break; 1530 - case 132: 1531 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1532 - { 1533 - #line 157 "Prexonite.lex" 1534 - return tok(Parser._false); 1535 - #line default 1536 - } 1537 - break; 1538 - case 113: 1539 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1540 - { 1541 - #line 156 "Prexonite.lex" 1542 - return tok(Parser._true); 1543 - #line default 1544 - } 1545 - break; 1546 - case 4: 1547 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1548 - { 1549 - #line 207 "Prexonite.lex" 1550 - return tok(Parser._plus); 1551 - #line default 1552 - } 1553 - break; 1554 - case 63: 1555 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1556 - { 1557 - #line 239 "Prexonite.lex" 1558 - return tok(Parser._appendleft); 1559 - #line default 1560 - } 1561 - break; 1562 - case 105: 1563 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1564 - { 1565 - #line 190 "Prexonite.lex" 1566 - return tok(Parser._id,OperatorNames.Prexonite.GreaterThan); 1567 - #line default 1568 - } 1569 - break; 1570 - case 101: 1571 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1572 - { 1573 - #line 120 "Prexonite.lex" 1574 - return tok(Parser._id,OperatorNames.Prexonite.Multiplication); 1575 - #line default 1576 - } 1577 - break; 1578 - case 91: 1579 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1580 - { 1581 - #line 335 "Prexonite.lex" 1582 - buffer.Append("\""); 1583 - #line default 1584 - } 1585 - break; 1586 - case 66: 1587 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1588 - { 1589 - #line 252 "Prexonite.lex" 1590 - buffer.Append("\""); 1591 - #line default 1592 - } 1593 - break; 1594 - case 53: 1595 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1596 - { 1597 - #line 219 "Prexonite.lex" 1598 - return tok(Parser._eq); 1599 - #line default 1600 - } 1601 - break; 1602 - case 44: 1603 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1604 - { 1605 - #line 226 "Prexonite.lex" 1606 - return tok(Parser._dec); 1607 - #line default 1608 - } 1609 - break; 1610 - case 97: 1611 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1612 - { 1613 - #line 164 "Prexonite.lex" 1614 - string ns = yytext(); 1615 - return tok(Parser._ns, ns.Substring(0, ns.Length-2)); 1616 - #line default 1617 - } 1618 - break; 1619 - case 16: 1620 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1621 - { 1622 - #line 233 "Prexonite.lex" 1623 - return tok(Parser._colon); 1624 - #line default 1625 - } 1626 - break; 1627 - case 37: 1628 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1629 - { 1630 - #line 323 "Prexonite.lex" 1631 - buffer.Append(yytext()); 1632 - #line default 1633 - } 1634 - break; 1635 - case 29: 1636 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1637 - { 1638 - #line 235 "Prexonite.lex" 1639 - return tok(Parser._comma); 1640 - #line default 1641 - } 1642 - break; 1643 - case 49: 1644 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1645 - { 1646 - #line 96 "Prexonite.lex" 1647 - return tok(Parser._to); 1648 - #line default 1649 - } 1650 - break; 1651 - case 78: 1652 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1653 - { 1654 - #line 289 "Prexonite.lex" 1655 - buffer.Append("$"); 1656 - #line default 1657 - } 1658 - break; 1659 - case 99: 1660 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1661 - { 1662 - #line 180 "Prexonite.lex" 1663 - return tok(Parser._id,OperatorNames.Prexonite.Subtraction); 1664 - #line default 1665 - } 1666 - break; 1667 - case 35: 1668 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1669 - { 1670 - #line 315 "Prexonite.lex" 1671 - throw new PrexoniteException("Invalid smart string character '" + yytext() + "' (ASCII " + ((int)yytext()[0]) + ") in input on line " + yyline + "."); 1672 - #line default 1673 - } 1674 - break; 1675 - case 62: 1676 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1677 - { 1678 - #line 213 "Prexonite.lex" 1679 - return tok(Parser._deltaleft); 1680 - #line default 1681 - } 1682 - break; 1683 - case 45: 1684 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1685 - { 1686 - #line 231 "Prexonite.lex" 1687 - return tok(Parser._pointer); 1688 - #line default 1689 - } 1690 - break; 1691 - case 56: 1692 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1693 - { 1694 - #line 215 "Prexonite.lex" 1695 - return tok(Parser._and); 1696 - #line default 1697 - } 1698 - break; 1699 - case 125: 1700 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1701 - { 1702 - #line 151 "Prexonite.lex" 1703 - return tok(Parser._version, yytext()); 1704 - #line default 1705 - } 1706 - break; 1707 - case 124: 1708 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1709 - { 1710 - #line 149 "Prexonite.lex" 1711 - return tok(Parser._real, yytext()); 1712 - #line default 1713 - } 1714 - break; 1715 - case 61: 1716 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1717 - { 1718 - #line 223 "Prexonite.lex" 1719 - return tok(Parser._le); 1720 - #line default 1721 - } 1722 - break; 1723 - case 52: 1724 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1725 - { 1726 - #line 107 "Prexonite.lex" 1727 - buffer.Length = 0; PushState(VerbatimString); 1728 - #line default 1729 - } 1730 - break; 1731 - case 122: 1732 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1733 - { 1734 - #line 193 "Prexonite.lex" 1735 - return tok(Parser._id,OperatorNames.Prexonite.LessThanOrEqual); 1736 - #line default 1737 - } 1738 - break; 1739 - case 38: 1740 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1741 - { 1742 - #line 319 "Prexonite.lex" 1743 - PopState(); 1744 - ret(tok(Parser._string, buffer.ToString())); 1745 - buffer.Length = 0; 1746 - 1747 - #line default 1748 - } 1749 - break; 1750 - case 59: 1751 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1752 - { 1753 - #line 222 "Prexonite.lex" 1754 - return tok(Parser._ge); 1755 - #line default 1756 - } 1757 - break; 1758 - case 110: 1759 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1760 - { 1761 - #line 288 "Prexonite.lex" 1762 - buffer.Append(_unescapeChar(yytext())); 1763 - #line default 1764 - } 1765 - break; 1766 - case 39: 1767 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1768 - { 1769 - #line 325 "Prexonite.lex" 1770 - buffer.Append("$"); 1771 - #line default 1772 - } 1773 - break; 1774 - case 118: 1775 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1776 - { 1777 - #line 189 "Prexonite.lex" 1778 - return tok(Parser._id,OperatorNames.Prexonite.Inequality); 1779 - #line default 1780 - } 1781 - break; 1782 - case 23: 1783 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1784 - { 1785 - #line 224 "Prexonite.lex" 1786 - return tok(Parser._lt); 1787 - #line default 1788 - } 1789 - break; 1790 - case 69: 1791 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1792 - { 1793 - #line 259 "Prexonite.lex" 1794 - buffer.Append("\r"); 1795 - #line default 1796 - } 1797 - break; 1798 - case 28: 1799 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1800 - { 1801 - #line 234 "Prexonite.lex" 1802 - return tok(Parser._semicolon); 1803 - #line default 1804 - } 1805 - break; 1806 - case 64: 1807 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1808 - { 1809 - #line 229 "Prexonite.lex" 1810 - return tok(Parser._coalescence); 1811 - #line default 1812 - } 1813 - break; 1814 - case 72: 1815 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1816 - { 1817 - #line 260 "Prexonite.lex" 1818 - buffer.Append("\v"); 1819 - #line default 1820 - } 1821 - break; 1822 - case 22: 1823 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1824 - { 1825 - #line 221 "Prexonite.lex" 1826 - return tok(Parser._gt); 1827 - #line default 1828 - } 1829 - break; 1830 - case 67: 1831 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1832 - { 1833 - #line 261 "Prexonite.lex" 1834 - buffer.Append("\t"); 1835 - #line default 1836 - } 1837 - break; 1838 - case 119: 1839 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1840 - { 1841 - #line 188 "Prexonite.lex" 1842 - return tok(Parser._id,OperatorNames.Prexonite.Equality); 1843 - #line default 1844 - } 1845 - break; 1846 - case 129: 1847 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1848 - { 1849 - #line 183 "Prexonite.lex" 1850 - return tok(Parser._id,OperatorNames.Prexonite.Modulus); 1851 - #line default 1852 - } 1853 - break; 1854 - case 85: 1855 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1856 - { 1857 - #line 277 "Prexonite.lex" 1858 - /* nothing to do */ 1859 - #line default 1860 - } 1861 - break; 1862 - case 131: 1863 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1864 - { 1865 - #line 197 "Prexonite.lex" 1866 - return tok(Parser._id,OperatorNames.Prexonite.UnaryDeltaLeftPre); 1867 - #line default 1868 - } 1869 - break; 1870 - case 126: 1871 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1872 - { 1873 - #line 200 "Prexonite.lex" 1874 - return tok(Parser._id,OperatorNames.Prexonite.UnaryDeltaRightPost); 1875 - #line default 1876 - } 1877 - break; 1878 - case 74: 1879 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1880 - { 1881 - #line 256 "Prexonite.lex" 1882 - buffer.Append("\b"); 1883 - #line default 1884 - } 1885 - break; 1886 - case 130: 1887 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1888 - { 1889 - #line 199 "Prexonite.lex" 1890 - return tok(Parser._id,OperatorNames.Prexonite.UnaryDeltaRightPre); 1891 - #line default 1892 - } 1893 - break; 1894 - case 106: 1895 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1896 - { 1897 - #line 192 "Prexonite.lex" 1898 - return tok(Parser._id,OperatorNames.Prexonite.LessThan); 1899 - #line default 1900 - } 1901 - break; 1902 - case 71: 1903 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1904 - { 1905 - #line 255 "Prexonite.lex" 1906 - buffer.Append("\a"); 1907 - #line default 1908 - } 1909 - break; 1910 - case 70: 1911 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1912 - { 1913 - #line 257 "Prexonite.lex" 1914 - buffer.Append("\f"); 1915 - #line default 1916 - } 1917 - break; 1918 - case 104: 1919 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1920 - { 1921 - #line 186 "Prexonite.lex" 1922 - return tok(Parser._id,OperatorNames.Prexonite.BitwiseOr); 1923 - #line default 1924 - } 1925 - break; 1926 - case 5: 1927 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1928 - { 1929 - #line 208 "Prexonite.lex" 1930 - return tok(Parser._minus); 1931 - #line default 1932 - } 1933 - break; 1934 - case 51: 1935 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1936 - { 1937 - #line 220 "Prexonite.lex" 1938 - return tok(Parser._ne); 1939 - #line default 1940 - } 1941 - break; 1942 - case 40: 1943 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1944 - { 1945 - #line 334 "Prexonite.lex" 1946 - buffer.Append(yytext()); 1947 - #line default 1948 - } 1949 - break; 1950 - case 75: 1951 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1952 - { 1953 - #line 258 "Prexonite.lex" 1954 - buffer.Append("\n"); 1955 - #line default 1956 - } 1957 - break; 1958 - case 98: 1959 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1960 - { 1961 - #line 179 "Prexonite.lex" 1962 - return tok(Parser._id,OperatorNames.Prexonite.Addition); 1963 - #line default 1964 - } 1965 - break; 1966 - case 47: 1967 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1968 - { 1969 - #line 170 "Prexonite.lex" 1970 - buffer.Length = 0; PushState(String); return tok(Parser._anyId); 1971 - #line default 1972 - } 1973 - break; 1974 - case 10: 1975 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1976 - { 1977 - #line 240 "Prexonite.lex" 1978 - return tok(Parser._not); 1979 - #line default 1980 - } 1981 - break; 1982 - case 54: 1983 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1984 - { 1985 - #line 232 "Prexonite.lex" 1986 - return tok(Parser._implementation); 1987 - #line default 1988 - } 1989 - break; 1990 - case 15: 1991 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 1992 - { 1993 - #line 236 "Prexonite.lex" 1994 - return tok(Parser._dot); 1995 - #line default 1996 - } 1997 - break; 1998 - case 3: 1999 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2000 - { 2001 - #line 174 "Prexonite.lex" 2002 - return tok(checkKeyword(yytext()), yytext()); 2003 - #line default 2004 - } 2005 - break; 2006 - case 102: 2007 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2008 - { 2009 - #line 184 "Prexonite.lex" 2010 - return tok(Parser._id,OperatorNames.Prexonite.Power); 2011 - #line default 2012 - } 2013 - break; 2014 - case 19: 2015 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2016 - { 2017 - #line 211 "Prexonite.lex" 2018 - return tok(Parser._pow); 2019 - #line default 2020 - } 2021 - break; 2022 - case 36: 2023 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2024 - { 2025 - #line 270 "Prexonite.lex" 2026 - PopState(); 2027 - ret(tok(Parser._string, buffer.ToString())); 2028 - buffer.Length = 0; 2029 - 2030 - #line default 2031 - } 2032 - break; 2033 - case 117: 2034 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2035 - { 2036 - #line 194 "Prexonite.lex" 2037 - return tok(Parser._id,OperatorNames.Prexonite.UnaryNegation); 2038 - #line default 2039 - } 2040 - break; 2041 - case 80: 2042 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2043 - { 2044 - #line 278 "Prexonite.lex" 2045 - buffer.Append("\0"); 2046 - #line default 2047 - } 2048 - break; 2049 - case 76: 2050 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2051 - { 2052 - #line 275 "Prexonite.lex" 2053 - buffer.Append("\\"); 2054 - #line default 2055 - } 2056 - break; 2057 - case 92: 2058 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2059 - { 2060 - #line 337 "Prexonite.lex" 2061 - string clipped; 2062 - string id = _pruneSmartStringIdentifier(yytext(), out clipped); 2063 - string fragment = buffer.ToString(); 2064 - buffer.Length = 0; 2065 - return multiple( 2066 - tok(Parser._string, fragment), 2067 - tok(Parser._plus), 2068 - tok(Parser._id, id), 2069 - clipped != null ? tok(Parser._plus) : null, 2070 - clipped != null ? tok(Parser._string, clipped) : null, 2071 - tok(Parser._plus) 2072 - ); 2073 - 2074 - #line default 2075 - } 2076 - break; 2077 - case 20: 2078 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2079 - { 2080 - #line 218 "Prexonite.lex" 2081 - return tok(Parser._bitAnd); 2082 - #line default 2083 - } 2084 - break; 2085 - case 11: 2086 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2087 - { 2088 - #line 237 "Prexonite.lex" 2089 - return tok(Parser._at); 2090 - #line default 2091 - } 2092 - break; 2093 - case 77: 2094 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2095 - { 2096 - #line 276 "Prexonite.lex" 2097 - buffer.Append("\""); 2098 - #line default 2099 - } 2100 - break; 2101 - case 50: 2102 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2103 - { 2104 - #line 97 "Prexonite.lex" 2105 - return tok(Parser._interpreterline); 2106 - #line default 2107 - } 2108 - break; 2109 - case 103: 2110 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2111 - { 2112 - #line 185 "Prexonite.lex" 2113 - return tok(Parser._id,OperatorNames.Prexonite.BitwiseAnd); 2114 - #line default 2115 - } 2116 - break; 2117 - case 33: 2118 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2119 - { 2120 - #line 266 "Prexonite.lex" 2121 - buffer.Append("$"); 2122 - #line default 2123 - } 2124 - break; 2125 - case 107: 2126 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2127 - { 2128 - #line 159 "Prexonite.lex" 2129 - return tok(Parser._ref); 2130 - #line default 2131 - } 2132 - break; 2133 - case 100: 2134 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2135 - { 2136 - #line 182 "Prexonite.lex" 2137 - return tok(Parser._id,OperatorNames.Prexonite.Division); 2138 - #line default 2139 - } 2140 - break; 2141 - case 120: 2142 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2143 - { 2144 - #line 202 "Prexonite.lex" 2145 - return tok(Parser._id,OperatorNames.Prexonite.BinaryDeltaRight); 2146 - #line default 2147 - } 2148 - break; 2149 - case 111: 2150 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2151 - { 2152 - #line 124 "Prexonite.lex" 2153 - return tok(Parser._timessym); 2154 - #line default 2155 - } 2156 - break; 2157 - default: 2158 - if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { 2159 - zzAtEOF = true; 2160 - if (ZZ_SPURIOUS_WARNINGS_SUCK) 2161 - { return tok(Parser._EOF); 2162 - } 2163 - break; 2164 - } 2165 - else { 2166 - zzScanError(ZZ_NO_MATCH); 2167 - } 2168 - break; 2169 - } 2170 - } 2171 - } 2172 - 2173 - 2174 - }
+6 -15
Prexonite/Prexonite.csproj
··· 1 - <Project Sdk="Microsoft.NET.Sdk"> 1 + <Project Sdk="Microsoft.NET.Sdk"> 2 2 3 3 <PropertyGroup> 4 4 <DefineConstants>UseIndex</DefineConstants> ··· 13 13 <PackageLicenseExpression>BSD-3-Clause</PackageLicenseExpression> 14 14 </PropertyGroup> 15 15 16 - <!-- CUSTOM TASKS --> 17 - <PropertyGroup> 18 - <!--<UseHostCompilerIfAvailable>False</UseHostCompilerIfAvailable> --> 19 - <BuildDependsOn> 20 - PrexoniteScanner; 21 - $(BuildDependsOn); 22 - </BuildDependsOn> 23 - <ToolsDirectory>$(ProjectDir)../Tools</ToolsDirectory> 24 - <PrexoniteScannerDefinition>Prexonite.lex</PrexoniteScannerDefinition> 25 - </PropertyGroup> 26 16 <ItemGroup> 17 + <AdditionalFiles Include="Compiler\Prexonite.lex" CSFlexOutput="Prexonite.Compiler.Lexer.g.cs" /> 27 18 <AdditionalFiles Include="Compiler\Grammar\Header.atg" PxCocoGrammar="Prexonite" PxCocoOrder="10" /> 28 19 <AdditionalFiles Include="Compiler\Grammar\Scanner.atg" PxCocoGrammar="Prexonite" PxCocoOrder="20" /> 29 20 <AdditionalFiles Include="Compiler\Grammar\Parser*.atg" PxCocoGrammar="Prexonite" PxCocoOrder="30" /> ··· 31 22 <AdditionalFiles Include="PTypeExpression.atg" PxCocoGrammar="PTypeExpression" PxCocoOrder="10" /> 32 23 <CompilerVisibleItemMetadata Include="AdditionalFiles" MetadataName="PxCocoGrammar" /> 33 24 <CompilerVisibleItemMetadata Include="AdditionalFiles" MetadataName="PxCocoOrder" /> 25 + <CompilerVisibleItemMetadata Include="AdditionalFiles" MetadataName="CSFlexOutput" /> 34 26 <None Remove="prxlib\legacy_symbols.pxs" /> 35 27 <None Remove="prxlib\prx.core.pxs" /> 36 28 <None Remove="prxlib\prx.prim.pxs" /> ··· 41 33 <EmbeddedResource Include="prxlib\prx.v1.prelude.pxs" /> 42 34 <EmbeddedResource Include="prxlib\prx.v2.prelude.pxs" /> 43 35 <EmbeddedResource Include="prxlib\sys.pxs" /> 44 - <None Remove="Compiler\Lexer.cs~" /> 45 36 </ItemGroup> 46 - <Target Name="PrexoniteScanner" Outputs="$(ProjectDir)/Compiler/Lexer.cs" Inputs="$(ProjectDir)/Compiler/$(PrexoniteScannerDefinition)"> 47 - <Exec Command="&quot;../$(ToolsDirectory)/csflex.exe&quot; --csharp --nested-default-skeleton --nobak $(PrexoniteScannerDefinition)" WorkingDirectory="$(ProjectDir)/Compiler" /> 48 - </Target> 49 37 50 38 <ItemGroup> 51 39 <!-- Generate the Properties/Resources.Designer.cs file from the default translations in Resources.resx --> ··· 62 50 63 51 <!-- NUGET References --> 64 52 <ItemGroup> 53 + <ProjectReference Include="..\CSFlex\CSFlex.csproj" 54 + OutputItemType="Analyzer" 55 + ReferenceOutputAssembly="false" /> 65 56 <ProjectReference Include="..\PxCoco\PxCoco.csproj" 66 57 OutputItemType="Analyzer" 67 58 ReferenceOutputAssembly="false" />
-5
Tools/CSFlex-license.txt
··· 1 - CSFlex is licensed under a slightly extended version of the GPLv2[1] which puts generated code under the control 2 - of the scanner grammar author (i.e., not also covered by the GPL). Source code can be obtained from [2] 3 - 4 - [1] https://sourceforge.net/p/csflex/code/HEAD/tree/trunk/COPYRIGHT 5 - [2] https://sourceforge.net/projects/csflex/
Tools/csflex.exe

This is a binary file and will not be displayed.

Tools/runtime.dll

This is a binary file and will not be displayed.

+1
prx.slnx
··· 1 1 <Solution> 2 + <Project Path="CSFlex/CSFlex.csproj" /> 2 3 <Project Path="Prexonite/Prexonite.csproj" /> 3 4 <Project Path="PrexoniteTests/PrexoniteTests.csproj" /> 4 5 <Project Path="PrexoniteTests.Generators/PrexoniteTests.Generators.csproj" />