コード例 #1
0
        public override ISitcomOper Clone(SitcomFile.Keyword keyword)
        {
            var oper = new SitcomOrOper(this);

            oper.keyword = keyword;
            return(oper);
        }
コード例 #2
0
        public override ISitcomOper Clone(SitcomFile.Keyword keyword)
        {
            var oper = new SitcomConditionOper();

            oper.keyword = keyword;
            return(oper);
        }
コード例 #3
0
 public override void AddContent(SitcomFile.Keyword keyword)
 {
     if (mLeft != null)
     {
         mLeft.AddContent(keyword);
     }
 }
コード例 #4
0
 public override ISitcomOper AddRightChild(ISitcomOper oper, out ISitcomOper replaced)
 {
     replaced = null;
     if (oper.Identify == SitcomDefine.OPER_COLON || oper.Identify == SitcomDefine.OPER_COLON2) // :
     {
         if (!mWaitContent)
         {
             mWaitContent = true;
             return(this);
         }
         if (mKey == null)
         {
             throw new SitcomCompileException(oper.keyword);
         }
         mKey.useKey = true;
         mUseKV      = true;
         return(this);
     }
     else if (!mWaitContent)
     {
         if (oper.Identify != SitcomDefine.OPER_REFERENCE)
         {
             throw new SitcomCompileException(oper.keyword);
         }
         mRight = oper.keyword;
         return(this);
     }
     else if (mKey == null)
     {
         mKey        = new KeyValue();
         mKey.key    = oper;
         oper.Parent = this;
         return(oper);
     }
     else if (mKey.useKey)
     {
         replaced    = mKey.value;
         mKey.value  = oper;
         oper.Parent = this;
         mKVs.Add(mKey);
         mKey = null;
         return(oper);
     }
     else
     {
         mKVs.Add(mKey);
         mKey        = new KeyValue();
         mKey.key    = oper;
         oper.Parent = this;
         return(oper);
     }
     throw new SitcomCompileException(oper.keyword);
 }
コード例 #5
0
        public ISitcomOper GetOperator(SitcomFile.Keyword keyword)
        {
            if (keyword.type == KeywordType.Content)
            {
                return(mDefaultOper.Clone(keyword));
            }
            var oper = GlobalUtil.Binsearch(mOperators, keyword.id);

            if (oper == null)
            {
                oper = mDefaultOper;
            }
            return(oper.Clone(keyword));
        }
コード例 #6
0
 public override void AddContent(SitcomFile.Keyword keyword)
 {
 }
コード例 #7
0
 public abstract void AddContent(SitcomFile.Keyword keyword);
コード例 #8
0
 public abstract ISitcomOper Clone(SitcomFile.Keyword keyword);
コード例 #9
0
 public override ISitcomOper Clone(SitcomFile.Keyword keyword)
 {
     this.keyword = keyword;
     return(this);
 }
コード例 #10
0
 public override void AddContent(SitcomFile.Keyword keyword)
 {
     throw new SitcomCompileException(keyword);
 }