Exemplo n.º 1
0
Arquivo: pass.c Projeto: ozra/ponyc
bool module_passes(ast_t* package, pass_opt_t* options, source_t* source)
{
  if(!pass_parse(package, source))
    return false;

  ast_t* module = ast_child(package);
  bool r;

  if(do_pass(&module, &r, options, PASS_SYNTAX, pass_syntax, NULL))
    return r;

  return true;
}
Exemplo n.º 2
0
Arquivo: pass.c Projeto: jonas-l/ponyc
bool module_passes(ast_t* package, pass_opt_t* options, source_t* source)
{
  if(!pass_parse(package, source))
    return false;

  if(options->limit < PASS_SYNTAX)
    return true;

  ast_t* module = ast_child(package);

  if(ast_visit(&module, pass_syntax, NULL, options, PASS_SYNTAX) != AST_OK)
    return false;

  check_tree(module);
  return true;
}
Exemplo n.º 3
0
sourcefile_t *assemble(void)
{
	sourcefile_t *src;


	newPass();

	if( (src=newSourcefile())!=NULL && cmdlineSourcefile(src, cmdLineSrc, cmdLineSrc_count) )
	{
		do
		{
			pass_cnt++;
			if( cfg_verbose )
			{
				printf("[pass %d]\n", pass_cnt);
			}

			if( !pass_parse(src) )
			{
				delSourcefile(src);
				src = NULL;
				break;
			}

			if( cfg_debug )
			{
				fprintf(debugLog, "<hr width=\"100%%\">\n<h1>[pass %d]</h1><p>\n", pass_cnt);
				fprintf(debugLog, "<hr width=\"100%%\">\n<h2>LABELS</h2><p>\n");
				dump(debugLog, (localdepth_t)-1,true);

				fprintf(debugLog, "<hr width=\"100%%\">\n<h2>SOURCE</h2><p>\n");
				src_debug(src, debugLog);
				segment_debug(debugLog);
			}
			if( cfg_verbose )
			{
				printf("\n");
			}

			if( cfg_verbose && errorcnt==0 )
			{
				if( allBytesResolved ) {
					printf("All bytes resolved\n");
				}
				else {
					printf("Unresolved bytes left\n");
				}
/*
				if( resolvedSomething() ) {
					printf("Undefined vars resolved in this pass\n");
				}
				else {
					printf("No undefined vars resolved in this pass\n");
				}
*/
			}

		} while( errorcnt==0 && resolvedSomething() && !allBytesResolved );
	}

	return src;
}