Add() public method

public Add ( Directive directive ) : DirectiveStack
directive Directive
return DirectiveStack
Exemplo n.º 1
0
        public HlslLexer(SourceText text, ParserOptions options = null, IIncludeFileSystem fileSystem = null)
        {
            _fileSystem = fileSystem ?? new DummyFileSystem();
            _directives = DirectiveStack.Empty;

            if (options != null)
                foreach (var define in options.PreprocessorDefines)
                {
                    _directives = _directives.Add(new Directive(new ObjectLikeDefineDirectiveTriviaSyntax(
                        null, null, SyntaxFactory.ParseToken(define), new List<SyntaxToken>
                        {
                            SyntaxFactory.ParseToken("1")
                        }, null, true)));
                }

            ExpandMacros = true;

            FileSegments = new List<FileSegment>();
            _includeStack = new Stack<IncludeContext>();
            PushIncludeContext(text);
        }