i was trying to use the algorithm and algorithmic environments to write some pseudocode.
i'm usin texnic and miktex on windows seven.
this is the pseudocode i'm trying to write:
Code: Select all
\begin{algorithm}
\label{REDUCE}
\caption{REDUCE(Pr, (\underline{Rel}, t))}
\begin{algorithmic}
\STATE $(\underline{Rel}, t) \gets lookahead di P_r$ \\
\STATE $P_j \gets LA(\underline{Rel})$ \\
\IF{$c(P_j) = t$} \\
\IF{ $P_r = A \rightarrow \alpha \cdot, (\underline{Rel}, t)$ \\
\state Riduci da $\alpha$ ad A senza spostare il cursore $P_i$ \\
\ELSIF{ $P_r = R \rightarrow \cdot, (\underline{R}, t)$ \\
\state $P_i \gets P_j$ \COMMENT{esegui lo spostamento effettivo} \\
\ENDIF \\
\ENDIF \\
\end{algorithmic}
\end{algorithm}
Code: Select all
Latex Error: there is no new line at the end
\IF{$c(P_j) = t$} \\
Runaway Argument?
{ $P_r = A \rightarrow \alpha \cdot, (\underline{Rel}, t)} \\ \state \ETC
