Esempio n. 1
0
        /// <summary>
        /// Renders a single IndexerExpression to VHDL
        /// </summary>
        /// <returns>The VHDL equivalent of the expression.</returns>
        /// <param name="e">The expression to render</param>
        private string RenderExpression(AST.IndexerExpression e)
        {
            var res = RenderExpression(e.TargetExpression);

            if (e.Target.Parent is AST.Bus)
            {
                return($"{res.Substring(0, res.Length - 1)}{RenderExpression(e.IndexExpression)})");
            }
            else
            {
                return($"{res}[{RenderExpression(e.IndexExpression)}]");
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Renders a single IndexerExpression to VHDL
 /// </summary>
 /// <returns>The VHDL equivalent of the expression.</returns>
 /// <param name="e">The expression to render</param>
 private string RenderExpression(AST.IndexerExpression e)
 {
     return(string.Format("{0}({1})", RenderExpression(e.TargetExpression), RenderExpression(e.IndexExpression)));
 }