Exemple #1
0
        public static void AddFlushFunctionToScope(Inizializator <ILCode> init)
        {
            var funInfo = new FunctionInfo(new List <KeyValuePair <string, TigerType> >(), TigerType.GetType <NoType>())
            {
                FunctionName = "flush",
                IsPredifined = true
            };
            var exit = new FunctionPredifined <ILCode>(funInfo, FlushFunction);

            init.AddPredifinedFunction(exit);
        }
Exemple #2
0
        public static void AddGetCharFunctionToScope(Inizializator <ILCode> init)
        {
            FunctionInfo funInfo;

            funInfo = new FunctionInfo(new List <KeyValuePair <string, TigerType> >(), TigerType.GetType <StringType>());
            funInfo.FunctionName = "getchar";
            funInfo.IsPredifined = true;
            var getChar = new FunctionPredifined <ILCode>(funInfo, GetCharFunction);

            init.AddPredifinedFunction(getChar);
        }
Exemple #3
0
        public static void AddCharFunctionToScope(Inizializator <ILCode> init)
        {
            FunctionInfo funInfo;

            funInfo = new FunctionInfo(new List <KeyValuePair <string, TigerType> >(), TigerType.GetType <StringType>());
            funInfo.ParameterList.Add(GetKeyValue("i", TigerType.GetType <IntType>()));
            funInfo.FunctionName = "chr";
            funInfo.IsPredifined = true;
            var chr = new FunctionPredifined <ILCode>(funInfo, CharFunction);

            init.AddPredifinedFunction(chr);
        }
Exemple #4
0
        public static void AddPrintIntFunctionToScope(Inizializator <ILCode> init)
        {
            FunctionInfo funInfo;

            funInfo = new FunctionInfo(new List <KeyValuePair <string, TigerType> >(), TigerType.GetType <NoType>());
            funInfo.ParameterList.Add(new KeyValuePair <string, TigerType>("i", TigerType.GetType <IntType>()));
            funInfo.FunctionName = "printi";
            funInfo.IsPredifined = true;

            var printi = new FunctionPredifined <ILCode>(funInfo, PrintIntFunction);

            init.AddPredifinedFunction(printi);
        }