<commit_before>using System;
using System.Collections.Generic;
using Antlr.Runtime;
using Antlr.Runtime.Tree;
using Iesi.Collections.Generic;

using NHibernate.Engine;
using NHibernate.Hql.Ast.ANTLR.Tree;
using NHibernate.Hql.Ast.ANTLR.Util;
using NHibernate.Id;
using NHibernate.Param;
using NHibernate.Persister.Collection;
using NHibernate.Persister.Entity;
using NHibernate.SqlCommand;
using NHibernate.Type;
using NHibernate.UserTypes;
using NHibernate.Util;

namespace NHibernate.Hql.Ast.ANTLR
{
	[CLSCompliant(false)]
	public partial class HqlSqlWalker
	{
		private static readonly IInternalLogger log = LoggerProvider.LoggerFor(typeof(HqlSqlWalker));

		// Fields
		private readonly string _collectionFilterRole;
		private readonly SessionFactoryHelperExtensions _sessionFactoryHelper;
		private readonly QueryTranslatorImpl _qti;
		private int _currentClauseType;
		private int _level;
		private bool _inSelect;
		private bool _inFrom;
		private bool _inFunctionCall;
		private bool _inCase;
		private int _statementType;
		private int _currentStatementType;
		private string _statementTypeName;
		private int _positionalParameterCount;
		private int _parameterCount;
		private readonly NullableDictionary<string, object> _namedParameters = new NullableDictionary<string, object>();
		private readonly List<IParameterSpecification> _parameters = new List<IParameterSpecification>();
		private FromClause _currentFromClause;
		private SelectClause _selectClause;
		private readonly AliasGenerator _aliasGenerator = new AliasGenerator();
		private readonly ASTPrinter _printer = new ASTPrinter();

		private readonly Set<string> _querySpaces = new HashedSet<string>();

		private readonly LiteralProcessor _literalProcessor;

		private readonly IDictionary<string, string> _tokenReplacements;

		private JoinType _impliedJoinType;

		private IParseErrorHandler _parseErrorHandler = new ErrorCounter();

		private IASTFactory _nodeFactory;
		private readonly List<AssignmentSpecification> assignmentSpecifications = new List<AssignmentSpecification>();
		private int numberOfParametersInSetClause;

		public HqlSqlWalker(QueryTranslatorImpl qti,
					  ISessionFactoryImplementor sfi,
					  ITreeNodeStream input, 
					  IDictionary<string, string> tokenReplacements,
					  string collectionRole)
			: this(input)
		{
			_sessionFactoryHelper = new SessionFactoryHelperExtensions(sfi);
			_qti = qti;
			_literalProcessor = new LiteralProcessor(this);
			_tokenReplacements = tokenReplacements;
			_collectionFilterRole = collectionRole;
		}

		public override void ReportError(RecognitionException e)
		{
			_parseErrorHandler.ReportError(e);
		}

		/*
		protected override void Mismatch(IIntStream input, int ttype, BitSet follow)
		{
		   throw new MismatchedTokenException(ttype, input);
		}

		public override object RecoverFromMismatchedSet(IIntStream input, RecognitionException e, BitSet follow)
		{
			throw e;
		}
		*/
		public IList<AssignmentSpecification> AssignmentSpecifications
		{
			get { return assignmentSpecifications; }
		}

		public int NumberOfParametersInSetClause
		{
			get { return numberOfParametersInSetClause; }
		}

		public IParseErrorHandler ParseErrorHandler
		{
			get { return _parseErrorHandler; }
			set { _parseErrorHandler = value; }
		}

		public AliasGenerator AliasGenerator
		{
			get { return _aliasGenerator; }
		}

		public Set<string> QuerySpaces
		{
			get { return _querySpaces; }
		}

	    public IDictionary<string, object> NamedParameters
	    {
            get { return _namedParameters; }
	    }

		internal SessionFactoryHelperExtensions SessionFactoryHelper
		{
			get { return _sessionFactoryHelper; }
		}
		
		public int CurrentStatementType
		{
			get { return _currentStatementType; }
		}

		public JoinType ImpliedJoinType
		{
			get { return _impliedJoinType; }
		}

		public String[] ReturnAliases
		{
			get { return _selectClause.QueryReturnAliases; }
		}<commit_msg>Don't type anything as Set<T> when ISet<T> will do just as fine (facilitate switch to SCG which doesn't have Set<T>).<commit_after>using System;
using System.Collections.Generic;
using Antlr.Runtime;
using Antlr.Runtime.Tree;
using Iesi.Collections.Generic;

using NHibernate.Engine;
using NHibernate.Hql.Ast.ANTLR.Tree;
using NHibernate.Hql.Ast.ANTLR.Util;
using NHibernate.Id;
using NHibernate.Param;
using NHibernate.Persister.Collection;
using NHibernate.Persister.Entity;
using NHibernate.SqlCommand;
using NHibernate.Type;
using NHibernate.UserTypes;
using NHibernate.Util;

namespace NHibernate.Hql.Ast.ANTLR
{
	[CLSCompliant(false)]
	public partial class HqlSqlWalker
	{
		private static readonly IInternalLogger log = LoggerProvider.LoggerFor(typeof(HqlSqlWalker));

		// Fields
		private readonly string _collectionFilterRole;
		private readonly SessionFactoryHelperExtensions _sessionFactoryHelper;
		private readonly QueryTranslatorImpl _qti;
		private int _currentClauseType;
		private int _level;
		private bool _inSelect;
		private bool _inFrom;
		private bool _inFunctionCall;
		private bool _inCase;
		private int _statementType;
		private int _currentStatementType;
		private string _statementTypeName;
		private int _positionalParameterCount;
		private int _parameterCount;
		private readonly NullableDictionary<string, object> _namedParameters = new NullableDictionary<string, object>();
		private readonly List<IParameterSpecification> _parameters = new List<IParameterSpecification>();
		private FromClause _currentFromClause;
		private SelectClause _selectClause;
		private readonly AliasGenerator _aliasGenerator = new AliasGenerator();
		private readonly ASTPrinter _printer = new ASTPrinter();

		private readonly ISet<string> _querySpaces = new HashedSet<string>();

		private readonly LiteralProcessor _literalProcessor;

		private readonly IDictionary<string, string> _tokenReplacements;

		private JoinType _impliedJoinType;

		private IParseErrorHandler _parseErrorHandler = new ErrorCounter();

		private IASTFactory _nodeFactory;
		private readonly List<AssignmentSpecification> assignmentSpecifications = new List<AssignmentSpecification>();
		private int numberOfParametersInSetClause;

		public HqlSqlWalker(QueryTranslatorImpl qti,
					  ISessionFactoryImplementor sfi,
					  ITreeNodeStream input, 
					  IDictionary<string, string> tokenReplacements,
					  string collectionRole)
			: this(input)
		{
			_sessionFactoryHelper = new SessionFactoryHelperExtensions(sfi);
			_qti = qti;
			_literalProcessor = new LiteralProcessor(this);
			_tokenReplacements = tokenReplacements;
			_collectionFilterRole = collectionRole;
		}

		public override void ReportError(RecognitionException e)
		{
			_parseErrorHandler.ReportError(e);
		}

		/*
		protected override void Mismatch(IIntStream input, int ttype, BitSet follow)
		{
		   throw new MismatchedTokenException(ttype, input);
		}

		public override object RecoverFromMismatchedSet(IIntStream input, RecognitionException e, BitSet follow)
		{
			throw e;
		}
		*/
		public IList<AssignmentSpecification> AssignmentSpecifications
		{
			get { return assignmentSpecifications; }
		}

		public int NumberOfParametersInSetClause
		{
			get { return numberOfParametersInSetClause; }
		}

		public IParseErrorHandler ParseErrorHandler
		{
			get { return _parseErrorHandler; }
			set { _parseErrorHandler = value; }
		}

		public AliasGenerator AliasGenerator
		{
			get { return _aliasGenerator; }
		}

		public ISet<string> QuerySpaces
		{
			get { return _querySpaces; }
		}

	    public IDictionary<string, object> NamedParameters
	    {
            get { return _namedParameters; }
	    }

		internal SessionFactoryHelperExtensions SessionFactoryHelper
		{
			get { return _sessionFactoryHelper; }
		}
		
		public int CurrentStatementType
		{
			get { return _currentStatementType; }
		}

		public JoinType ImpliedJoinType
		{
			get { return _impliedJoinType; }
		}

		public String[] ReturnAliases
		{
			get { return _selectClause.QueryReturnAliases; }
		}
{'fraction_non_alphanumeric': 0.06493993993993993, 'fraction_numerical': 0.0, 'mean_word_length': 4.907612712490761, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1205637', 'n_tokens_mistral': 2601, 'n_tokens_neox': 2242, 'n_words': 573}