| 1 |
\begin{itemize} |
| 2 |
\item \textbf{Missing information in rule headers}: Rule headers will not be generated correctly if the original rules contain \texttt{extends} or \texttt{expression}. Those qualifiers will be missing in the generated rule since they are not included in the output of the parser. |
| 3 |
|
| 4 |
Fix: Change the parser to include this information. |
| 5 |
\item \textbf{Typedefs in rule headers}: If there are meta typedefs in the original rule headers, they will be included in every generated rule that uses the type. This causes an error when using the generated script since meta typedefs can only be declared once. |
| 6 |
|
| 7 |
Fix: Remove the error check in the parser since this should not cause an error. |
| 8 |
\item Disjunction generation has a number of issues: |
| 9 |
\begin{itemize} |
| 10 |
\item \textbf{Selecting wrong position in statement dots cases}: There must be the same number of positions in each disjunction case, otherwise \texttt{org} and \texttt{report} will only match when all positions can be found. In statement dots disjunctions, this is currently solved by putting the position at the first possible statement. The issue here is that, if the case contains many statements, only the first surrounding statement will be highlighted instead of the important part. |
| 11 |
|
| 12 |
Fix: Implement support for finding a single best statement in a statement dots (list of statements). |
| 13 |
\item \textbf{Nested disjunctions}: The position counter is frozen within a disjunction. But if there is a nested disjunction inside it, the same position will be used in both disjunction levels, causing a nonsensical script. |
| 14 |
|
| 15 |
Fix: Keep track of the current nest and name the position accordingly. |
| 16 |
\end{itemize} |
| 17 |
\item \textbf{No format string metavariable check}: The user can specify metavariables to be used in the messages for \texttt{org} and \texttt{report} mode. The program currently does not check if the declared metavariables actually exist in the original rule. |
| 18 |
|
| 19 |
Fix: Implement check of metavariables. |
| 20 |
\item \textbf{Dependencies between patch rules}: It is possible to make patch rules that depend on other patch rules modifying the code. E.g. if one patch rule transforms f(0) and one transforms f(e), then f(0) will only match the first, since it is transformed to something else when it reaches the f(e) rule. But in \texttt{context} mode, both rules will print the f(0) occurrence. |
| 21 |
|
| 22 |
Fix: ??? Somehow detect that two rules will match the same case and insert constraints such that any match in subsequent rules does not match the first one. |
| 23 |
\item \textbf{Dependencies in context rules}: In a \texttt{context} script, if there are dependencies between rules, they might be mixed up. This happens if there are rules dependent on the generated rules since they will then be printed before the rules on which they are dependent! |
| 24 |
|
| 25 |
Fix: ??? |
| 26 |
\item \textbf{Type and switch case disjunctions}: Currently, the program fails if attempting to generate a \texttt{Coccinelle} script with type or switch case disjunctions. The failure happens in the position generator. The reason it is not implemented is that it requires quite a lot of code for a case that rarely appears. |
| 27 |
|
| 28 |
Fix: Implement full position generation for types and switch cases. |
| 29 |
\item \textbf{File transformation not context-dependent}: When printing the transformed script, a somewhat primitive string replacement strategy is used to rename rules and inject dependencies (e.g. change \texttt{@rulename@} to \texttt{@rulename depends on patch@}). The transformation is not context-dependent which means that the script will get mangled if there is e.g. a \texttt{@@} \textit{inside comments} on a new line, since this will be mistaken for a SmPL-syntax \texttt{@@}. |
| 30 |
|
| 31 |
Fix: Use simple parsing in the file transformation. Another solution is to not transform the original file at all, but to completely reconstruct it from the AST (this requires a pretty printer for AST that retains comments and plus slices!). In practice, however, this is only a problem in very specific cases that are unlikely to occur. |
| 32 |
\end{itemize} |