Guest User

Untitled

a guest
Aug 29th, 2011
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.07 KB | None | 0 0
  1. from foo import bar
  2. [0, 'from', 'foo', 'import', 'bar']
  3.  
  4. import foobar
  5. [0, 'import', 'foobar']
  6.  
  7. from zort import *
  8. [0, 'from', 'zort', 'import', '*']
  9.  
  10. section Device:
  11. [0, 'section', 'Device', ':']
  12.  
  13.     MCU = "atmega128"
  14. [4, 'MCU', '=', '"atmega128"']
  15.  
  16.     F_CPU = 16000000
  17. [4, 'F_CPU', '=', '16000000']
  18.  
  19. section Flash:
  20. [0, 'section', 'Flash', ':']
  21.  
  22.     s as string = "Hallo Welt"
  23. [4, 's', 'as', 'string', '=', '"Hallo Welt"']
  24.  
  25.     c as char = 'c'
  26. [4, 'c', 'as', 'char', '=', "'c'"]
  27.  
  28.     b as int8 = -5
  29. [4, 'b', 'as', 'int8', '=', '-5']
  30.  
  31.     i as int16 = 10
  32. [4, 'i', 'as', 'int16', '=', '10']
  33.  
  34.     l as int32 = 234123
  35. [4, 'l', 'as', 'int32', '=', '234123']
  36.  
  37. section Eeprom:
  38. [0, 'section', 'Eeprom', ':']
  39.  
  40.     ub as uint8 = 0b01011010
  41. [4, 'ub', 'as', 'uint8', '=', '0b01011010']
  42.  
  43.     ui as uint16 = 0xffff
  44. [4, 'ui', 'as', 'uint16', '=', '0xffff']
  45.  
  46.     ul as uint32 = 0xFFFFFFFF
  47. [4, 'ul', 'as', 'uint32', '=', '0xFFFFFFFF']
  48.  
  49. section Xram:
  50. [0, 'section', 'Xram', ':']
  51.  
  52.     pi as float = 3.1415
  53. [4, 'pi', 'as', 'float', '=', '3.1415']
  54.  
  55.     liste as list = ["Hallo", "Hello", 10, 100]
  56. [4, 'liste', 'as', 'list', '=', '[', '"Hallo"', ',', '"Hello"', ',', '10,', '100', ']']
  57.  
  58.     hashlist as dict = {"key1": 10, "key2": 50}
  59. [4, 'hashlist', 'as', 'dict', '=', '{', '"key1"', ':', '10,', '"key2"', ':', '50', '}']
  60.  
  61.     tup as tuple = "val1", "val2", 25, 1.0
  62. [4, 'tup', 'as', 'tuple', '=', '"val1"', ',', '"val2"', ',', '25,', '1.0']
  63.  
  64. e as float=2.71828183
  65. [0, 'e', 'as', 'float', '=', '2.71828183']
  66.  
  67. def foo():
  68. [0, 'def', 'foo', '(', ')', ':']
  69.  
  70.     z=foo.bar()
  71. [4, 'z', '=', 'foo.bar', '(', ')']
  72.  
  73.     if z<>10:
  74. [4, 'if', 'z<>10', ':']
  75.  
  76.         do.something()
  77. [8, 'do.something', '(', ')']
  78.  
  79. def foo(i as int8):
  80. [0, 'def', 'foo', '(', 'i', 'as', 'int8', ')', ':']
  81.  
  82.     pass
  83. [4, 'pass']
  84.  
  85. def foo() as bool:
  86. [0, 'def', 'foo', '(', ')', 'as', 'bool', ':']
  87.  
  88.     return TRUE
  89. [4, 'return', 'TRUE']
  90.  
  91. def foo(i as int16, j as int8 = 0):
  92. [0, 'def', 'foo', '(', 'i', 'as', 'int16,', 'j', 'as', 'int8', '=', '0', ')', ':']
  93.  
  94.     pass
  95. [4, 'pass']
Advertisement
Add Comment
Please, Sign In to add comment