public static void generateTMCode( String inputFileName, SemanticAction programNode )
  {
    for( SemanticAction def: programNode.getBranches() ){
      if( def.getName().equals("main") ){
        for( SemanticAction child: def.getBranches() ){
          if( child.getType() == SemanticAction.TYPE.FORMAL ){
            appendRegisterMemory( "LD", registerCounter, offsetCounter, 0 );          
          }
        }
        
        appendRegisterMemory( "LDA", returnAddress, 1, programCounter ); // LDA 1, 1(7)
        appendRegisterMemory( "LDA", programCounter, (currentLineNumber + 3), 0 );
        appendRegisterOnly(   "OUT", returnValue, 0, 0 );
        appendRegisterOnly(   "HALT", 0, 0, 0 );
      }
    }
    
    //recurseTree( programNode );
    writeOutputFile( inputFileName );
  }