Example #1
0
		/// <summary>
		/// Builds AST from the given source code string.
		/// Returns <B>null</B> if the AST cannot be built (new declarations appears in the code).
		/// </summary>
		internal List<Statement> BuildAst(Position initialPosition, string/*!*/ sourceCode)
		{
			Parser.ReductionsCounter counter = new Parser.ReductionsCounter();

            var ast = BuildAst(initialPosition, sourceCode, counter);

			if (counter.FunctionCount + counter.TypeCount + counter.ConstantCount > 0)
				return null;

			return ast.Statements;
		}
Example #2
0
		/// <summary>
		/// Builds AST from the given source code string.
		/// Returns <B>null</B> if the AST cannot be built (new declarations appears in the code).
		/// </summary>
        internal Statement[] BuildAst(int positionShift, string/*!*/ sourceCode)
		{
			Parser.ReductionsCounter counter = new Parser.ReductionsCounter();

            var ast = BuildAst(positionShift, sourceCode, counter);

			if (counter.FunctionCount + counter.TypeCount + counter.ConstantCount > 0)
				return null;

			return ast.Statements;
		}