Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from foo import bar
- [0, 'from', 'foo', 'import', 'bar']
- import foobar
- [0, 'import', 'foobar']
- from zort import *
- [0, 'from', 'zort', 'import', '*']
- section Device:
- [0, 'section', 'Device', ':']
- MCU = "atmega128"
- [4, 'MCU', '=', '"atmega128"']
- F_CPU = 16000000
- [4, 'F_CPU', '=', '16000000']
- section Flash:
- [0, 'section', 'Flash', ':']
- s as string = "Hallo Welt"
- [4, 's', 'as', 'string', '=', '"Hallo Welt"']
- c as char = 'c'
- [4, 'c', 'as', 'char', '=', "'c'"]
- b as int8 = -5
- [4, 'b', 'as', 'int8', '=', '-5']
- i as int16 = 10
- [4, 'i', 'as', 'int16', '=', '10']
- l as int32 = 234123
- [4, 'l', 'as', 'int32', '=', '234123']
- section Eeprom:
- [0, 'section', 'Eeprom', ':']
- ub as uint8 = 0b01011010
- [4, 'ub', 'as', 'uint8', '=', '0b01011010']
- ui as uint16 = 0xffff
- [4, 'ui', 'as', 'uint16', '=', '0xffff']
- ul as uint32 = 0xFFFFFFFF
- [4, 'ul', 'as', 'uint32', '=', '0xFFFFFFFF']
- section Xram:
- [0, 'section', 'Xram', ':']
- pi as float = 3.1415
- [4, 'pi', 'as', 'float', '=', '3.1415']
- liste as list = ["Hallo", "Hello", 10, 100]
- [4, 'liste', 'as', 'list', '=', '[', '"Hallo"', ',', '"Hello"', ',', '10,', '100', ']']
- hashlist as dict = {"key1": 10, "key2": 50}
- [4, 'hashlist', 'as', 'dict', '=', '{', '"key1"', ':', '10,', '"key2"', ':', '50', '}']
- tup as tuple = "val1", "val2", 25, 1.0
- [4, 'tup', 'as', 'tuple', '=', '"val1"', ',', '"val2"', ',', '25,', '1.0']
- e as float=2.71828183
- [0, 'e', 'as', 'float', '=', '2.71828183']
- def foo():
- [0, 'def', 'foo', '(', ')', ':']
- z=foo.bar()
- [4, 'z', '=', 'foo.bar', '(', ')']
- if z<>10:
- [4, 'if', 'z<>10', ':']
- do.something()
- [8, 'do.something', '(', ')']
- def foo(i as int8):
- [0, 'def', 'foo', '(', 'i', 'as', 'int8', ')', ':']
- pass
- [4, 'pass']
- def foo() as bool:
- [0, 'def', 'foo', '(', ')', 'as', 'bool', ':']
- return TRUE
- [4, 'return', 'TRUE']
- def foo(i as int16, j as int8 = 0):
- [0, 'def', 'foo', '(', 'i', 'as', 'int16,', 'j', 'as', 'int8', '=', '0', ')', ':']
- pass
- [4, 'pass']
Advertisement
Add Comment
Please, Sign In to add comment