예제 #1
0
 public ITokenForestNode AddOrGetExistingTokenNode(IToken token)
 {
     ITokenForestNode tokenNode = null;
     if (_tokenNodes.TryGetValue(token, out tokenNode))
         return tokenNode;
     tokenNode = new TokenForestNode(token, token.Origin, token.Value.Length);
     _tokenNodes.Add(token, tokenNode);
     return tokenNode;
 }
예제 #2
0
 public ITokenForestNode AddOrGetExistingTokenNode(IToken token)
 {
     if (_tokenNodes.TryGetValue(token, out ITokenForestNode tokenNode))
     {
         return(tokenNode);
     }
     tokenNode = new TokenForestNode(token, token.Position, token.Capture.Count);
     _tokenNodes.Add(token, tokenNode);
     return(tokenNode);
 }
예제 #3
0
        public ITokenForestNode AddOrGetExistingTokenNode(IToken token)
        {
            if (this._tokenNodes.TryGetValue(token, out var tokenNode))
            {
                return(tokenNode);
            }

            tokenNode = new TokenForestNode(token);
            this._tokenNodes.Add(token, tokenNode);
            return(tokenNode);
        }
예제 #4
0
        public ITokenForestNode AddOrGetExistingTokenNode(IToken token)
        {
            ITokenForestNode tokenNode = null;

            if (_tokenNodes.TryGetValue(token, out tokenNode))
            {
                return(tokenNode);
            }
            tokenNode = new TokenForestNode(token, token.Position, token.Value.Length);
            _tokenNodes.Add(token, tokenNode);
            return(tokenNode);
        }
예제 #5
0
 private IForestNode CreateNullParseNode(ISymbol symbol, int location)
 {
     var symbolNode = _nodeSet.AddOrGetExistingSymbolNode(symbol, location, location);
     var token = new Token(string.Empty, location, new TokenType(string.Empty));
     var nullNode = new TokenForestNode(token, location, location);
     symbolNode.AddUniqueFamily(nullNode);
     return symbolNode;
 }