Exemple #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;
 }
Exemple #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);
 }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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;
 }