Jan. 23, 2024, 4:29 a.m. | Chig Beef

DEV Community dev.to




Intro


In this series I am creating a transpiler from Python to Golang called Pogo. In the last post we created a bunch of functions that will allow us to easily construct the abstract syntax tree from our source, a slice of Tokens. Creating the AST is the last step before we can start emitting code!





The Main Function



func (p *Parser) parse(input []Token) Structure {
if len(input) == 0 {
log.Fatal("[Parse (parse)] Missing input")
}

p.source = input …

abstract compiler construct functions go golang intro python series series i syntax tokens transpiler tree will

AI Research Scientist

@ Vara | Berlin, Germany and Remote

Data Architect

@ University of Texas at Austin | Austin, TX

Data ETL Engineer

@ University of Texas at Austin | Austin, TX

Lead GNSS Data Scientist

@ Lurra Systems | Melbourne

Senior Machine Learning Engineer (MLOps)

@ Promaton | Remote, Europe

Senior Software Engineer, Generative AI (C++)

@ SoundHound Inc. | Toronto, Canada