Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [
  2.     Program: "Block",
  3.     Block: {
  4.         min: 1,
  5.         of: [
  6.             "Class",
  7.             "Import",
  8.             "Function",
  9.             "Block"
  10.         ]
  11.     },
  12.     Class: {
  13.         series: [
  14.             "class", "Id", "{",
  15.             {
  16.                 min: 0,
  17.                 of: "ClassMember",
  18.             },
  19.             "}"
  20.         ]
  21.     },
  22.     Import: {
  23.         series: [
  24.             "import", "Id", {
  25.                 min: 0,
  26.                 of: {
  27.                     sequence: [
  28.                         ".", "Id"
  29.                     ]
  30.                 }
  31.             }
  32.         ]
  33.     },
  34.     Function: {
  35.         series: [
  36.             "Type", "Id", "(",
  37.                 {
  38.                     max: 1,
  39.                     of: "Parameter"
  40.                 },
  41.                 {
  42.                     min: 0,
  43.                     of: {
  44.                         series: [
  45.                             ",", "Parameter"
  46.                         ]
  47.                     }
  48.                 },
  49.             ")", "Block"
  50.         ]
  51.     },
  52.     Type: "Id",
  53.     Parameter: {
  54.         series: [
  55.             "Type", "Id"
  56.         ]
  57.     },
  58.     Block: {
  59.         series: [
  60.             "{",
  61.             {
  62.                 min: 0,
  63.                 of: "Statement",
  64.             },
  65.             "}"
  66.         ]
  67.     },
  68.     Statement: {
  69.         of: [
  70.             "FunctionCall",
  71.             "Declaration",
  72.             "Block"
  73.         ]
  74.     },
  75.     FunctionCall: {
  76.         series: [
  77.             "Id", "(", "Value", {
  78.                 min: 0,
  79.                 of: {
  80.                     series: [ ",", "Value" ]
  81.                 }
  82.             }, ")"
  83.         ]
  84.     },
  85.     Declaration: {
  86.         series: [
  87.             "Type", "Id", {
  88.                 max: 1,
  89.                 of: {
  90.                     series: [ "=", "Value" ]
  91.                 }
  92.             }
  93.         ]
  94.     },
  95.     Value: {
  96.         of: [
  97.             "Variable",
  98.             "FunctionCall",
  99.             "Function"
  100.         ]
  101.     },
  102.     Variable: {
  103.         of: [
  104.             "Literal",
  105.             "Id"
  106.         ]
  107.     },
  108.     Literal: {
  109.         of: [
  110.             "StringLiteral",
  111.             "IntegerLiteral",
  112.             "DecimalLiteral"
  113.         ]
  114.     },
  115.     StringLiteral: "/\\\"[^\\\"]*\\\"/",
  116.     IntegerLiteral: "/(\d[xb])\d+/"/
  117.     DecimalLiteral: "/\d*\.\d*/"/
  118.     Id: "/[\w_$~][\w_$~\d]*/"  
  119. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement