I am trying to apply the following answer: https://tex.stackexchange.com/a/72916/25124
What is wrong with this code? I am trying to define a macro to be able to specify a table of 3 columns but whose central column are always arrows. It looks like the error comes from \begin{tabular} but I'm not sure.
\documentclass[a4paper]{article}
\usepackage[utf8x]{inputenc}
\usepackage{array}
\title{Your Paper}
\author{You}
\begin{document}
\newif\ifrulesetSep
\newcommand*{\ruleset}[1]{%
\begin{center}\begin{tabular}[rcl]
\rulesetSepfalse
\ruleScan#1\relax\relax
}
\newcommand{\ruleScan}[2]{%
\ifx\relax#1
\end{tabular}\end{center}
\else
\ifrulesetSep
\\
\else
\rulesetSeptrue
\fi
#1 & $\rightarrow$ & #2
\expandafter\ruleScan
\fi
}
\ruleset{
{A}{B C}
{B}{b}
{C}{c A B}
}
\end{document}
I get the error
Package array Error: Illegal pream-token (\rulesetSepfalse): `c' used.
\begin{tabular}[rcl]
should be\begin{tabular}{rcl}