Syntax patterns: more statistics.

Ruslan Shevchenko rssh at gradsoft.com.ua
Fri Apr 24 09:33:01 PDT 2009


> 2009/4/24 Ruslan Shevchenko <rssh at gradsoft.com.ua>:
>> To say something concrete, I need to see full define term.
>> I. e. starts from define( .... ═and up to ,)
>
> This is what I tried:
>
>  define(Elvis,coin,"elvis",
>         BT_TYPE_RULESET,
>         ruleset(
>           ConditionalExpression(
>            EqualityExpression($x,"==",NullLiteral()),
>                  $y,  $x) -> true
>                  [ violationDiscovered(Elvis, "elvis", $method) ],
> ... similar for the other three
>         ),true),
>
> But it didn't work.
>
>

 $method in violationDiscovered now is free variable, which have no line and
number information.

// how this work inside -- javachecker retrieve location information from
first identifier, found inside term in third parameter.
So, better write something in style
>  define(Elvis,coin,"elvis",
>         BT_TYPE_RULESET,
>         ruleset(
>           ConditionalExpression(
>            EqualityExpression($x,"==",NullLiteral()),
>                  $y,  $x) -> true
>                  [ violationDiscovered(Elvis, "elvis", $x) ],
> ... similar for the other three
>         ),true),

And what mean 'does not work' ?
Let's define some common small dataset.



> The second one was to find all conditionals - aiming to find any and
> all conditional statements:
>
>  define(AllConditionals,coin,"all conditionals",
>         BT_TYPE_RULESET,
>         ruleset(
>           ConditionalExpression($x,$y,$z)
>                 -> true [ violationDiscovered(AllConditionals, "all
> conditionals",$x) ]
>          ),
>          true
>  ),
>
> That is working fine.
>
>
> I should also note that the iterator remove() only catches remove()
> within a while-statement, and not within an iterator-driven
> for-statement.

Yes. Will be fixed.  (I guess iterator-driven for statement does not exist
in life and usually written as while, but better check all, of course.)

>
> Stephen
>
>





More information about the coin-dev mailing list