示例#1
0
        /// <summary>
        /// Save method will not update the existing file if the content is same.
        /// This is useful for optimization of external DSL analysis, such as DSL IntelliSense plugin.
        /// </summary>
        public void Save(DslSyntax dslSyntax)
        {
            string newContent = JsonConvert.SerializeObject(dslSyntax, _jsonSettings);

            string oldContent = File.Exists(DslSyntaxFilePath)
                ? File.ReadAllText(DslSyntaxFilePath)
                : null;

            if (newContent != oldContent)
            {
                File.WriteAllText(DslSyntaxFilePath, newContent);
            }
        }
示例#2
0
 public TokenizerInternals(DslSyntax syntax)
 {
     _syntax = syntax;
 }
 public DslSyntaxFileGenerator(DslSyntax dslSyntax, DslSyntaxFile dslSyntaxFile)
 {
     _dslSyntax     = dslSyntax;
     _dslSyntaxFile = dslSyntaxFile;
 }
示例#4
0
 public DslDocumentationFileGenerator(DslSyntax dslSyntax, ILogProvider logProvider, DslDocumentationFile dslDocumentationFile)
 {
     _dslSyntax            = dslSyntax;
     _dslDocumentationFile = dslDocumentationFile;
     _logger = logProvider.GetLogger(GetType().Name);
 }