Skip to content

Commit

Permalink
bug fix in lexer atn config
Browse files Browse the repository at this point in the history
  • Loading branch information
Egbert.Voigt authored and Egbert.Voigt committed Mar 9, 2020
1 parent 5ad7731 commit 6195a54
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 26,807 deletions.
Binary file modified model/DRuntime.zargo
Binary file not shown.
35 changes: 4 additions & 31 deletions source/antlr/v4/runtime/atn/LexerATNConfig.d
Original file line number Diff line number Diff line change
@@ -1,32 +1,7 @@
/*
* [The "BSD license"]
* Copyright (c) 2016 Terence Parr
* Copyright (c) 2016 Sam Harwell
* Copyright (c) 2017 Egbert Voigt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
* Use of this file is governed by the BSD 3-clause license that
* can be found in the LICENSE.txt file in the project root.
*/

module antlr.v4.runtime.atn.LexerATNConfig;
Expand All @@ -47,7 +22,6 @@ class LexerATNConfig : ATNConfig
{

/**
* @uml
* This is the backing field for {@link #getLexerActionExecutor}.
*/
public LexerActionExecutor lexerActionExecutor;
Expand Down Expand Up @@ -98,7 +72,6 @@ class LexerATNConfig : ATNConfig
}

/**
* @uml
* Gets the {@link LexerActionExecutor} capable of executing the embedded
* action(s) for the current configuration.
*/
Expand Down Expand Up @@ -154,7 +127,7 @@ class LexerATNConfig : ATNConfig
public static bool checkNonGreedyDecision(LexerATNConfig source, ATNState target)
{
return source.passedThroughNonGreedyDecision
|| target.classinfo == DecisionState.classinfo && (cast(DecisionState)target).nonGreedy;
|| cast(DecisionState)target && (cast(DecisionState)target).nonGreedy;
}

}
2 changes: 2 additions & 0 deletions source/antlr/v4/runtime/atn/LexerATNSimulator.d
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ class LexerATNSimulator : ATNSimulator
protected bool closure(CharStream input, LexerATNConfig config, ATNConfigSet configs,
bool currentAltReachedAcceptState, bool speculative, bool treatEofAsEpsilon)
{
debug(LexerATNSimulator)
writefln("closure(\"%s\")", config);
if (cast(RuleStopState)config.state) {
debug(LexerATNSimulator) {
if (recog !is null) {
Expand Down

0 comments on commit 6195a54

Please sign in to comment.