You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
452 B
JavaScript
30 lines
452 B
JavaScript
"use strict";
|
|
|
|
class Node {
|
|
|
|
constructor( type, location ) {
|
|
|
|
this.type = type;
|
|
this.location = location;
|
|
|
|
}
|
|
|
|
}
|
|
exports.Node = Node;
|
|
|
|
class Grammar extends Node {
|
|
|
|
// Creates a new AST
|
|
constructor( initializer, rules, comments, location ) {
|
|
|
|
super( "grammar", location );
|
|
|
|
this.initializer = initializer;
|
|
this.comments = comments;
|
|
this.rules = rules;
|
|
|
|
}
|
|
|
|
}
|
|
exports.Grammar = Grammar;
|