| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 34 | 2 | 1 | 0.998 | class_member_declaration |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 34 | 109 | src/NHibernate/Hql/Ast/ANTLR/HqlParser.cs |
| 2 | 42 | 146 | src/NHibernate/Hql/Ast/ANTLR/HqlParser.cs |
| ||||
public void WeakKeywords()
{
int t = input.LA(1);
switch (t)
{
case ORDER:
case GROUP:
// Case 1: Multi token keywords GROUP BY and ORDER BY
// The next token ( LT(2) ) should be 'by'... otherwise, this is just an ident.
if (input.LA(2) != LITERAL_by)
{
input.LT(1).Type = IDENT;
if (log.IsDebugEnabled)
{
log.Debug("weakKeywords() : new LT(1) token - " + input.LT(1));
}
}
break;
default:
// Case 2: The current token is after FROM and before '.'.
if (t != IDENT && input.LA( - 1) == FROM && input.LA(2) == DOT)
{
HqlToken hqlToken = (HqlToken)input.LT(1);
if (hqlToken.PossibleId)
{
hqlToken.Type = IDENT;
if (log.IsDebugEnabled)
{
log.Debug("weakKeywords() : new LT(1) token - " + input.LT(1));
}
}
}
break;
}
}
|
| ||||
public void WeakKeywords2()
{
/*
* path
* alias in class? path
* in open path close
* alias in elements open path close
* elements open path close
* alias in path dot elements
*/
int t = input.LA(1);
switch (t)
{
case ORDER:
case GROUP:
// Case 1: Multi token keywords GROUP BY and ORDER BY
// The next token ( LT(2) ) should be 'by'... otherwise, this is just an ident.
if (input.LA(2) != LITERAL_by)
{
input.LT(1).Type = IDENT;
if (log.IsDebugEnabled)
{
log.Debug("weakKeywords() : new LT(1) token - " + input.LT(1));
}
}
break;
default:
// Case 2: The current token is after FROM and before '.'.
if (t != IDENT && input.LA( - 1) == FROM && input.LA(2) == DOT)
{
HqlToken hqlToken = (HqlToken)input.LT(1);
if (hqlToken.PossibleId)
{
hqlToken.Type = IDENT;
if (log.IsDebugEnabled)
{
log.Debug("weakKeywords() : new LT(1) token - " + input.LT(1));
}
}
}
break;
}
}
|
| |||
public void [[#variable6975a320]]()
{
/*
* path
* alias in class? path
* in open path close
* alias in elements open path close
* elements open path close
* alias in path dot elements
*/
int t = input.LA(1);
switch (t)
{
case ORDER:
case GROUP:
// Case 1: Multi token keywords GROUP BY and ORDER BY
// The next token ( LT(2) ) should be 'by'... otherwise, this is just an ident.
if (input.LA(2) != LITERAL_by)
{
input.LT(1).Type = IDENT;
if (log.IsDebugEnabled)
{
log.Debug("weakKeywords() : new LT(1) token - " + input.LT(1));
}
}
break;
default:
// Case 2: The current token is after FROM and before '.'.
if (t != IDENT && input.LA( - 1) == FROM && input.LA(2) == DOT)
{
HqlToken hqlToken = (HqlToken)input.LT(1);
if (hqlToken.PossibleId)
{
hqlToken.Type = IDENT;
if (log.IsDebugEnabled)
{
log.Debug("weakKeywords() : new LT(1) token - " + input.LT(1));
}
}
}
break;
}
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#6975a320]] | WeakKeywords |
| 1 | 2 | [[#6975a320]] | WeakKeywords2 |