예제 #1
0
 internal DirectiveNode(
     DirectiveToken directiveToken,
     SourceText sourceText,
     PolyglotSyntaxTree?syntaxTree) : base(directiveToken.DirectiveName, sourceText, syntaxTree)
 {
     Add(directiveToken);
 }
예제 #2
0
 internal KernelNameDirectiveNode(
     DirectiveToken directiveToken,
     SourceText sourceText,
     PolyglotSyntaxTree?syntaxTree) : base(directiveToken, sourceText, syntaxTree)
 {
     KernelName = directiveToken.DirectiveName;
 }
예제 #3
0
 internal ProxyKernelNameDirectiveNode(
     string remoteKernelName,
     DirectiveToken directiveToken,
     SourceText sourceText,
     PolyglotSyntaxTree?syntaxTree) : base(directiveToken, sourceText, syntaxTree)
 {
     RemoteKernelName = remoteKernelName;
 }
예제 #4
0
 internal ActionDirectiveNode(
     DirectiveToken directiveToken,
     SourceText sourceText,
     string parentKernelName,
     PolyglotSyntaxTree?syntaxTree) : base(directiveToken, sourceText, syntaxTree)
 {
     ParentKernelName = parentKernelName;
 }
예제 #5
0
        private bool IsLanguageDirective(DirectiveToken directiveToken)
        {
            if (_kernelChooserDirectives is null)
            {
                _kernelChooserDirectives = new HashSet <string>(
                    _directives
                    .OfType <ChooseKernelDirective>()
                    .SelectMany(c => c.Aliases));
            }

            return(_kernelChooserDirectives.Contains(directiveToken.Text));
        }
예제 #6
0
        private bool IsLanguageDirective(DirectiveToken directiveToken)
        {
            if (_kernelChooserDirectives is null &&
                _subkernelDirectiveParsersByLanguageName != null)
            {
                _kernelChooserDirectives = new HashSet <string>(
                    _rootKernelDirectiveParser
                    .Configuration
                    .RootCommand
                    .Children
                    .OfType <ChooseKernelDirective>()
                    .SelectMany(c => c.Aliases)
                    );
            }

            return(_kernelChooserDirectives?.Contains(directiveToken.Text) == true);
        }
예제 #7
0
 internal DirectiveNode(DirectiveToken directiveToken, SourceText sourceText) : base("#!-directive", sourceText)
 {
     Add(directiveToken);
 }
예제 #8
0
 internal KernelDirectiveNode(
     DirectiveToken directiveToken,
     SourceText sourceText) : base(directiveToken, sourceText)
 {
     KernelName = directiveToken.DirectiveName;
 }