Пример #1
0
        private LeafElementBase CreateCurrentToken()
        {
            T4TokenNodeType tokenType = GetTokenType();

            Assertion.AssertNotNull(tokenType, "tokenType == null");
            LeafElementBase token = tokenType.Create(_builderLexer.Buffer, new TreeOffset(_builderLexer.TokenStart), new TreeOffset(_builderLexer.TokenEnd));

            return(token);
        }
Пример #2
0
        /// <summary>
        /// Creates and appends a new token to the tree.
        /// </summary>
        /// <param name="parentElement">The parent element.</param>
        /// <param name="tokenNodeType">Type of the token node to create and add.</param>
        private void AppendNewChild([NotNull] CompositeElement parentElement, [NotNull] T4TokenNodeType tokenNodeType)
        {
            var token = tokenNodeType.Create(_builderLexer.Buffer, new TreeOffset(_builderLexer.TokenStart), new TreeOffset(_builderLexer.TokenEnd));

            _builderLexer.AppendNewChild(parentElement, token);
        }