Changeset c5cb943d in mainline for uspace/dist/src/sysel/demos


Ignore:
Timestamp:
2010-06-09T19:01:08Z (16 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1113c9e
Parents:
051bc69a
Message:

Update SBI to rev. 291.

Location:
uspace/dist/src/sysel/demos
Files:
2 added
18 edited

Legend:

Unmodified
Added
Removed
  • uspace/dist/src/sysel/demos/arith.sy

    r051bc69a rc5cb943d  
    2828
    2929class ArithmeticDemo is
    30         fun Main() is
     30        fun Main(), static is
    3131                -- Test addition, multiplication and precedence.
    3232                Builtin.Write("2*2 + 2*2 = ");
     
    8888
    8989        -- Return factorial of n.
    90         fun Factorial(n : int) : int is
     90        fun Factorial(n : int) : int, static is
    9191                var i : int;
    9292                var val : int;
  • uspace/dist/src/sysel/demos/array.sy

    r051bc69a rc5cb943d  
    2828
    2929class ArrayDemo is
    30         fun Main() is
     30        fun Main(), static is
    3131                var a : int[,];
    3232                var i : int;
  • uspace/dist/src/sysel/demos/autobox.sy

    r051bc69a rc5cb943d  
    2828
    2929class AutoboxingDemo is
    30         fun Main() is
     30        fun Main(), static is
    3131                var b : Bool;
    3232                var c : Char;
     
    5151        end
    5252
    53         fun foo(args : Object[], packed) is
     53        fun foo(args : Object[], packed), static is
    5454        end
    5555end
  • uspace/dist/src/sysel/demos/count.sy

    r051bc69a rc5cb943d  
    2828
    2929class CountDemo is
    30         fun Count(a : int; b : int) is
     30        fun Count(a : int; b : int), static is
    3131                var i : int;
    3232
     
    3939        end
    4040
    41         fun Main() is
     41        fun Main(), static is
    4242                Count(0, 10);
    4343        end
  • uspace/dist/src/sysel/demos/ctor.sy

    r051bc69a rc5cb943d  
    2828
    2929class ConstructorDemo is
    30         fun Main() is
     30        fun Main(), static is
    3131                var a : A;
    3232
  • uspace/dist/src/sysel/demos/deleg.sy

    r051bc69a rc5cb943d  
    2828
    2929class DelegateDemo is
    30         fun Main() is
     30        fun Main(), static is
    3131                var demo : DelegateClass;
    3232
  • uspace/dist/src/sysel/demos/enum.sy

    r051bc69a rc5cb943d  
    2828
    2929class EnumDemo is
    30         fun Main() is
     30        fun Main(), static is
    3131                var color : ChessColor;
    3232
  • uspace/dist/src/sysel/demos/except.sy

    r051bc69a rc5cb943d  
    2828
    2929class ExceptionDemo is
    30         fun foo() is
     30        fun foo(), static is
    3131                Builtin.WriteLine("Entered foo().");
    3232                raise new BaseException();
    3333        end
    3434
    35         fun Main() is
     35        fun Main(), static is
    3636                do
    3737                        foo();
  • uspace/dist/src/sysel/demos/gen.sy

    r051bc69a rc5cb943d  
    3030
    3131class GenericsDemo is
    32         fun Main() is
     32        fun Main(), static is
    3333                Builtin.WriteLine("Let's try some generics.");
    3434
  • uspace/dist/src/sysel/demos/hello.sy

    r051bc69a rc5cb943d  
    2828
    2929class HelloWorld is
    30         fun Main() is
     30        fun Main(), static is
    3131                Builtin.WriteLine("Hello world!");
    3232        end
  • uspace/dist/src/sysel/demos/hexec.sy

    r051bc69a rc5cb943d  
    2828
    2929class HelenOSExecDemo is
    30         fun Main() is
     30        fun Main(), static is
    3131                Task.Exec("/app/tester");
    3232                Task.Exec("/app/tester", "print1");
  • uspace/dist/src/sysel/demos/htxtfile.sy

    r051bc69a rc5cb943d  
    2828
    2929class TextFileDemo is
    30         fun Main() is
     30        fun Main(), static is
    3131                var name : string;
    3232                var line : string;
  • uspace/dist/src/sysel/demos/inherit.sy

    r051bc69a rc5cb943d  
    4343
    4444class InheritanceDemo is
    45         fun Main() is
     45        fun Main(), static is
    4646                var a : A;
    4747                var c : C;
  • uspace/dist/src/sysel/demos/list.sy

    r051bc69a rc5cb943d  
    2929-- Using the List class from the library.
    3030class ListDemo is
    31         fun Main() is
     31        fun Main(), static is
    3232                var list : List/int;
    3333
     
    3939                list.Append(8);
    4040
    41                 var n : ListNode/int;
     41                var e : IEnumerator/int;
    4242
    43                 n = list.First;
    44                 while n != nil do
    45                         Builtin.WriteLine(n.Data);
    46                         n = n.Next;
     43                e = list.GetEnumerator();
     44                while e.MoveNext() do
     45                        Builtin.WriteLine(e.Data);
    4746                end
    4847        end
  • uspace/dist/src/sysel/demos/map.sy

    r051bc69a rc5cb943d  
    2929-- Using the Map class from the library.
    3030class MapDemo is
    31         fun Main() is
     31        fun Main(), static is
    3232                var map : Map/string/int;
    3333
     
    3939                map["four"] = 4;
    4040
    41                 Builtin.WriteLine(map["one"]);
    42                 Builtin.WriteLine(map["two"]);
    43                 Builtin.WriteLine(map["three"]);
    44                 Builtin.WriteLine(map["four"]);
     41                var e : IEnumerator/string;
     42
     43                e = map.GetEnumerator();
     44                while e.MoveNext() do
     45                        Builtin.Write(e.Data);
     46                        Builtin.Write(" -> ");
     47                        Builtin.WriteLine(map[e.Data]);
     48                end
    4549        end
    4650end
  • uspace/dist/src/sysel/demos/property.sy

    r051bc69a rc5cb943d  
    9898
    9999class PropertyDemo is
    100         fun Main() is
     100        fun Main(), static is
    101101                var a : Foo;
    102102                var i : int;
  • uspace/dist/src/sysel/demos/string.sy

    r051bc69a rc5cb943d  
    2828
    2929class StringDemo is
    30         fun Main() is
     30        fun Main(), static is
    3131                -- Concatenate some strings.
    3232                Builtin.WriteLine("One-" + "two-" + "three!");
  • uspace/dist/src/sysel/demos/varargs.sy

    r051bc69a rc5cb943d  
    3333        -- with the attribute 'packed'.
    3434        --
    35         fun Print(args : string[], packed) is
     35        fun Print(args : string[], packed), static is
    3636                var i : int;
    3737                var error : bool;
     
    5353        end
    5454
    55         fun Main() is
     55        fun Main(), static is
    5656                Print("One", "Two", "Three", "Four", "Five");
    5757        end
Note: See TracChangeset for help on using the changeset viewer.