Beispiel #1
0
        public void SetPointer(Pointer pointer, EnegyData data, VariabelDatabase db, Posision pos)
        {
            PointerContainer pc = pointer.GetPointerContainer();

            Control(pc.Name, data, db, pos);//control if the class contains the name already

            if (pc.IsStatic)
                container.StaticPointer.Add(pc.Name, pc);
            else
                container.Pointer.Add(pc.Name, pc);
        }
Beispiel #2
0
        private bool buildVariabel(ClassItemAccessLevel level, bool isStatic, Token token, EnegyData data)
        {
            //it is a variabel :)
            //okay it is a variabel ?
            if (token.getCache().type() != TokenType.Variabel) {
                data.setError(new ScriptError("1 Unknown token in class (" + builder.GetContainer().Name + ") body: " + token.getCache().ToString() + " | " + token.getCache().type().ToString(), token.getCache().posision()), db);
                return false;
            }

            Pointer pointer = new Pointer(token.getCache().ToString());

            if(token.next().type() == TokenType.Assigen)
            {
                token.next();
                pointer.SetDefault(new VariabelParser().parse(data, db, token));
            }else if(token.getCache().type() == TokenType.End)
            {
                token.next();
            }
            else
            {
                data.setError(new ScriptError("2 Unknown token in class ("+builder.GetContainer().Name+") body: " + token.getCache().ToString(), token.getCache().posision()), db);
                return false;
            }

            if (isStatic)
                pointer.SetStatic();

            pointer.SetLevel(level);

            builder.SetPointer(pointer, data, db, token.getCache().posision());
            return true;
        }