Esempio n. 1
0
        /// <summary>
        /// Analyses a string.
        /// </summary>
        /// <param name="s">String to analyse.</param>
        /// <param name="tOptions">Tokenizer options.</param>
        /// <param name="aOptions">Analyser options.</param>
        /// <returns>The resulting AST.</returns>
        public static Expr AnalyseString(string s, TokenizerOptions tOptions = null, AnalyzerOptions aOptions = null)
        {
            Analyzer a = new Analyzer(aOptions);

            return(a.Analyse(new Tokenizer(s, tOptions)));
        }
Esempio n. 2
0
 /// <summary>
 /// Initialzes a new <see cref="Analyzer"/>.
 /// </summary>
 /// <param name="options">Analyser options to use.</param>
 public Analyzer(AnalyzerOptions options = null)
 {
     _options = options ?? _defaultOptions;
     _scope   = new StaticScope(_options.ShareGlobalScope, _options.AllowScopeMasking, _options.AllowScopeLocalRedefinition);
 }