示例#1
0
文件: IronyAst.cs 项目: phreed/GMac
        /// <summary>
        /// Define a new primitive language operator for this language
        /// </summary>
        /// <param name="opName">The operator name</param>
        /// <param name="opSymbolString">The operator symbol</param>
        /// <returns></returns>
        public OperatorPrimitive DefineLanguageOperatorPrimitive(string opName, string opSymbolString)
        {
            if (OperatorPrimitiveDictionary.ContainsKey(opName))
            {
                return(OperatorPrimitiveDictionary[opName]);
            }

            var newOp = OperatorPrimitive.Create(opName, opSymbolString);

            OperatorPrimitiveDictionary.Add(opName, newOp);

            return(newOp);
        }
示例#2
0
文件: IronyAst.cs 项目: phreed/GMac
        /// <summary>
        /// Define a new primitive language operator for this language
        /// </summary>
        /// <param name="opName">The operator name</param>
        /// <returns></returns>
        public OperatorPrimitive DefineLanguageOperatorPrimitive(string opName)
        {
            if (OperatorPrimitiveDictionary.ContainsKey(opName))
            {
                return(OperatorPrimitiveDictionary[opName]);
            }

            var newOp = OperatorPrimitive.Create(opName);

            OperatorPrimitiveDictionary.Add(opName, newOp);

            //if (EnableLogger)
            //    _Logger.AddFullLine("Defining language role " + new_op.OperatorName);

            return(newOp);
        }