Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [
- Program: "Block",
- Block: {
- min: 1,
- of: [
- "Class",
- "Import",
- "Function",
- "Block"
- ]
- },
- Class: {
- series: [
- "class", "Id", "{",
- {
- min: 0,
- of: "ClassMember",
- },
- "}"
- ]
- },
- Import: {
- series: [
- "import", "Id", {
- min: 0,
- of: {
- sequence: [
- ".", "Id"
- ]
- }
- }
- ]
- },
- Function: {
- series: [
- "Type", "Id", "(",
- {
- max: 1,
- of: "Parameter"
- },
- {
- min: 0,
- of: {
- series: [
- ",", "Parameter"
- ]
- }
- },
- ")", "Block"
- ]
- },
- Type: "Id",
- Parameter: {
- series: [
- "Type", "Id"
- ]
- },
- Block: {
- series: [
- "{",
- {
- min: 0,
- of: "Statement",
- },
- "}"
- ]
- },
- Statement: {
- of: [
- "FunctionCall",
- "Declaration",
- "Block"
- ]
- },
- FunctionCall: {
- series: [
- "Id", "(", "Value", {
- min: 0,
- of: {
- series: [ ",", "Value" ]
- }
- }, ")"
- ]
- },
- Declaration: {
- series: [
- "Type", "Id", {
- max: 1,
- of: {
- series: [ "=", "Value" ]
- }
- }
- ]
- },
- Value: {
- of: [
- "Variable",
- "FunctionCall",
- "Function"
- ]
- },
- Variable: {
- of: [
- "Literal",
- "Id"
- ]
- },
- Literal: {
- of: [
- "StringLiteral",
- "IntegerLiteral",
- "DecimalLiteral"
- ]
- },
- StringLiteral: "/\\\"[^\\\"]*\\\"/",
- IntegerLiteral: "/(\d[xb])\d+/"/
- DecimalLiteral: "/\d*\.\d*/"/
- Id: "/[\w_$~][\w_$~\d]*/"
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement