コード例 #1
0
ファイル: Query.cs プロジェクト: sitopmn/logviewer
        /// <summary>
        /// Initializes a new instance of the <see cref="Query"/> class.
        /// </summary>
        /// <param name="log">The log to query</param>
        /// <param name="settings">The application settings</param>
        /// <param name="query">The query string to execute</param>
        internal Query(Log log, Node tree)
        {
            _log  = log;
            _tree = tree;

            // define result columns for the query
            var visitor = new FieldsVisitor();

            _tree.Accept(visitor);
            _columns = visitor.Fields;
            if (visitor.GeneratesDynamicFields)
            {
                _dynamicColumns = new Dictionary <string, Type>();
            }

            // print the query tree for debugging
            var format = new FormatVisitor();

            _tree.Accept(format);
            _logger.Info($"Created query tree\r\n" + format.ToString().TrimEnd());
        }
コード例 #2
0
ファイル: TermVisitor.cs プロジェクト: davidelettieri/Tapl
 public TermVisitor()
 {
     _fieldsVisitor = new FieldsVisitor(this);
     _casesVisitor  = new CasesVisitor(this);
 }