コード例 #1
0
        /// <summary>
        /// Generates the code for a FunctionCall node.
        /// </summary>
        /// <param name="fc">The FunctionCall node.</param>
        /// <returns>String containing C# code for FunctionCall fc.</returns>
        private string GenerateFunctionCall(FunctionCall fc)
        {
            string retstr = String.Empty;

            string modinvoke = null;
            if (m_comms != null)
                modinvoke = m_comms.LookupModInvocation(fc.Id);
            
            if (modinvoke != null)
            {
                if (fc.kids[0] is ArgumentList)
                {
                    if ((fc.kids[0] as ArgumentList).kids.Count == 0)
                        retstr += Generate(String.Format("{0}(\"{1}\"",modinvoke,fc.Id), fc);
                    else
                        retstr += Generate(String.Format("{0}(\"{1}\",",modinvoke,fc.Id), fc);
                }
            }
            else
            {
                retstr += Generate(String.Format("{0}(", CheckName(fc.Id)), fc);
            }
            
            foreach (SYMBOL kid in fc.kids)
                retstr += GenerateNode(fc, kid);

            retstr += Generate(")");

            return retstr;
        }
コード例 #2
0
        /// <summary>
        /// Generates the code for a FunctionCall node.
        /// </summary>
        /// <param name="fc">The FunctionCall node.</param>
        /// <returns>String containing C# code for FunctionCall fc.</returns>
        private string GenerateFunctionCall(FunctionCall fc)
        {
            string retstr = String.Empty;

            retstr += Generate(String.Format("{0}(", CheckName(fc.Id)), fc);

            foreach (SYMBOL kid in fc.kids)
                retstr += GenerateNode(kid);

            retstr += Generate(")");

            return retstr;
        }
コード例 #3
0
ファイル: lsl.parser.cs プロジェクト: BackupTheBerlios/seleon
 public  FunctionCallExpression (Parser yyp, FunctionCall  fc ):base(((LSLSyntax
)yyp)){ kids . Add ( fc );
}
コード例 #4
0
ファイル: lsl.parser.cs プロジェクト: BackupTheBerlios/seleon
 public  Statement (Parser yyp, FunctionCall  fc ):base(((LSLSyntax
)yyp)){ kids . Add ( fc );
}