// Path: src/main/java/org/hummingbirdlang/nodes/HBSourceRootNode.java
// public class HBSourceRootNode extends RootNode implements InferenceVisitable {
//   @Child private HBBlockNode bodyNode;
//   private final SourceSection sourceSection;
//   @CompilationFinal private BuiltinScope builtinScope;
// 
//   public HBSourceRootNode(HBLanguage language, SourceSection sourceSection, FrameDescriptor frameDescriptor, HBBlockNode bodyNode) {
//     super(language, frameDescriptor);
//     this.sourceSection = sourceSection;
//     this.bodyNode = bodyNode;
//   }
// 
//   public void accept(InferenceVisitor visitor) throws TypeException {
//     visitor.enter(this);
//     this.bodyNode.accept(visitor);
//     visitor.leave(this);
//   }
// 
//   public void setBuiltinScope(BuiltinScope builtinScope) {
//     this.builtinScope = builtinScope;
//   }
// 
//   @Override
//   public Object execute(VirtualFrame frame) {
//     FrameDescriptor frameDescriptor = frame.getFrameDescriptor();
// 
//     try {
//       Bindings bindings = new Bindings(this.builtinScope);
//       FrameSlot frameSlot = frameDescriptor.findOrAddFrameSlot(Bindings.IDENTIFIER);
//       frame.setObject(frameSlot, bindings);
// 
//       this.bodyNode.executeVoid(frame);
//     } catch (Exception exception) {
//       throw new RuntimeException(exception);
//     }
//     return null;
//   }
// 
//   @Override
//   public SourceSection getSourceSection() {
//     return this.sourceSection;
//   }
// 
//   @Override
//   public String toString() {
//     StringBuilder result = new StringBuilder("HBSourceRootNode(");
//     result.append(bodyNode.toString());
//     result.append(")");
//     return result.toString();
//   }
// }
// 
// Path: src/main/java/org/hummingbirdlang/HBLanguage.java
// @TruffleLanguage.Registration(name = "Hummingbird", version = "0.1", mimeType = HBLanguage.MIME_TYPE)
// public final class HBLanguage extends TruffleLanguage<HBContext> {
//   public static final String MIME_TYPE = "application/x-hummingbird";
// 
//   public HBLanguage() {
//   }
// 
//   @Override
//   protected HBContext createContext(Env env) {
//     BufferedReader in = new BufferedReader(new InputStreamReader(env.in()));
//     PrintWriter out = new PrintWriter(env.out(), true);
//     return new HBContext(env, in, out);
//   }
// 
//   @Override
//   protected CallTarget parse(ParsingRequest request) throws Exception {
//     Source source = request.getSource();
//     HBSourceRootNode program = ParserWrapper.parse(this, source);
// 
//     System.out.println(program.toString());
// 
//     // Bootstrap the builtin node targets and the builtin types in the
//     // type-system.
//     BuiltinNodes builtinNodes = BuiltinNodes.bootstrap(this);
//     Index index = Index.bootstrap(builtinNodes);
// 
//     InferenceVisitor visitor = new InferenceVisitor(index);
//     program.accept(visitor);
// 
//     return Truffle.getRuntime().createCallTarget(program);
//   }
// 
//   // TODO: Fully remove this deprecated implementation.:
//   //
//   //   @Override
//   //   protected CallTarget parse(Source source, Node node, String... argumentNames) throws Exception {
//   //     Object program = ParserWrapper.parse(source);
//   //     System.out.println(program.toString());
//   //     return null;
//   //   }
// 
//   // Called when some other language is seeking for a global symbol.
//   @Override
//   protected Object findExportedSymbol(HBContext context, String globalName, boolean onlyExplicit) {
//     return null;
//   }
// 
//   @Override
//   protected Object getLanguageGlobal(HBContext context) {
//     // Context is the highest level global.
//     return context;
//   }
// 
//   @Override
//   protected boolean isObjectOfLanguage(Object object) {
//     return false;
//   }
// }


import com.oracle.truffle.api.source.Source;
import org.hummingbirdlang.nodes.HBSourceRootNode;
import org.hummingbirdlang.HBLanguage;
package org.hummingbirdlang.parser;



public class ParserWrapper {
  public static HBSourceRootNode parse(HBLanguage language, Source source) throws Exception {
// Path: src/main/java/org/hummingbirdlang/nodes/HBSourceRootNode.java
// public class HBSourceRootNode extends RootNode implements InferenceVisitable {
//   @Child private HBBlockNode bodyNode;
//   private final SourceSection sourceSection;
//   @CompilationFinal private BuiltinScope builtinScope;
// 
//   public HBSourceRootNode(HBLanguage language, SourceSection sourceSection, FrameDescriptor frameDescriptor, HBBlockNode bodyNode) {
//     super(language, frameDescriptor);
//     this.sourceSection = sourceSection;
//     this.bodyNode = bodyNode;
//   }
// 
//   public void accept(InferenceVisitor visitor) throws TypeException {
//     visitor.enter(this);
//     this.bodyNode.accept(visitor);
//     visitor.leave(this);
//   }
// 
//   public void setBuiltinScope(BuiltinScope builtinScope) {
//     this.builtinScope = builtinScope;
//   }
// 
//   @Override
//   public Object execute(VirtualFrame frame) {
//     FrameDescriptor frameDescriptor = frame.getFrameDescriptor();
// 
//     try {
//       Bindings bindings = new Bindings(this.builtinScope);
//       FrameSlot frameSlot = frameDescriptor.findOrAddFrameSlot(Bindings.IDENTIFIER);
//       frame.setObject(frameSlot, bindings);
// 
//       this.bodyNode.executeVoid(frame);
//     } catch (Exception exception) {
//       throw new RuntimeException(exception);
//     }
//     return null;
//   }
// 
//   @Override
//   public SourceSection getSourceSection() {
//     return this.sourceSection;
//   }
// 
//   @Override
//   public String toString() {
//     StringBuilder result = new StringBuilder("HBSourceRootNode(");
//     result.append(bodyNode.toString());
//     result.append(")");
//     return result.toString();
//   }
// }
// 
// Path: src/main/java/org/hummingbirdlang/HBLanguage.java
// @TruffleLanguage.Registration(name = "Hummingbird", version = "0.1", mimeType = HBLanguage.MIME_TYPE)
// public final class HBLanguage extends TruffleLanguage<HBContext> {
//   public static final String MIME_TYPE = "application/x-hummingbird";
// 
//   public HBLanguage() {
//   }
// 
//   @Override
//   protected HBContext createContext(Env env) {
//     BufferedReader in = new BufferedReader(new InputStreamReader(env.in()));
//     PrintWriter out = new PrintWriter(env.out(), true);
//     return new HBContext(env, in, out);
//   }
// 
//   @Override
//   protected CallTarget parse(ParsingRequest request) throws Exception {
//     Source source = request.getSource();
//     HBSourceRootNode program = ParserWrapper.parse(this, source);
// 
//     System.out.println(program.toString());
// 
//     // Bootstrap the builtin node targets and the builtin types in the
//     // type-system.
//     BuiltinNodes builtinNodes = BuiltinNodes.bootstrap(this);
//     Index index = Index.bootstrap(builtinNodes);
// 
//     InferenceVisitor visitor = new InferenceVisitor(index);
//     program.accept(visitor);
// 
//     return Truffle.getRuntime().createCallTarget(program);
//   }
// 
//   // TODO: Fully remove this deprecated implementation.:
//   //
//   //   @Override
//   //   protected CallTarget parse(Source source, Node node, String... argumentNames) throws Exception {
//   //     Object program = ParserWrapper.parse(source);
//   //     System.out.println(program.toString());
//   //     return null;
//   //   }
// 
//   // Called when some other language is seeking for a global symbol.
//   @Override
//   protected Object findExportedSymbol(HBContext context, String globalName, boolean onlyExplicit) {
//     return null;
//   }
// 
//   @Override
//   protected Object getLanguageGlobal(HBContext context) {
//     // Context is the highest level global.
//     return context;
//   }
// 
//   @Override
//   protected boolean isObjectOfLanguage(Object object) {
//     return false;
//   }
// }


// Path: src/main/java/org/hummingbirdlang/parser/ParserWrapper.java
import com.oracle.truffle.api.source.Source;
import org.hummingbirdlang.nodes.HBSourceRootNode;
import org.hummingbirdlang.HBLanguage;

package org.hummingbirdlang.parser;



public class ParserWrapper {
  public static HBSourceRootNode parse(HBLanguage language, Source source) throws Exception {
    Parser parser = new Parser(language, source);