Example #1
0
void Decl()
{
   switch (Symb.type) {
   case kwVAR:
      DeclVar();
      Decl();
      break;
   case kwCONST:
      DeclConst();
      Decl();
      break;
   default:
      ;
   }
}
Example #2
0
bool Parser::OptDeclList()
{
	if ("function" == lex ||
		"begin" == lex) {
		std::cout << "OptDeclList => null\n";
		return true;
	}
	
	if (!Decl()) return false;
	if (!OptDeclList()) return false;
	
	std::cout << "OptDeclList => Decl OptDeclList\n";
	return true;
}
void TopDecls() {
  EmitLn("section .data");
  Scan();
  while(Token != 'b') {
    switch(Token) {
      case 'v': Decl(); break;
      default:
        sprintf(tmp,"Unrecognized Keyword '%s'", Value);
        Abort(tmp);
    }
    Scan();
    NewLine();
  }
}
Example #4
0
JNIEXPORT void JNICALL Java_com_example_glessandbox_NDKSandbox_update(JNIEnv* env, jobject obj)
{
	static int frame;
	frame++;

	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	glUseProgram(gProgram);
	glUniform1i(glGetUniformLocation(gProgram, "sampler1"), 0);
	glUniform1i(glGetUniformLocation(gProgram, "sampler2"), 1);
	glUniform1f(glGetUniformLocation(gProgram, "time"), (float)frame / 60.0f);

	glBindBuffer(GL_ARRAY_BUFFER, vbo);

	Decl(decl, dimof(decl));
	glDrawArrays(GL_TRIANGLE_STRIP, 0, dimof(vert));
//	glDisableVertexAttribArray(mPositionHandle);
}
Example #5
0
/* parse and translate global declarations */
void TopDecls(void)
{
    printf(".section .data\n");
    char tmp_buf[MAX_BUF];
    while(Look != 'B') {
        switch(Look) {
            case 'b':
            case 'w':
            case 'l':
                Decl();
                break;
            default:
                sprintf(tmp_buf, "Unrecognized keyword %c", Look);
                Abort(tmp_buf);
                break;
        }
        Fin();
    }
}
Example #6
0
Prog *Program()
{
   Decl();
   return new Prog(CompoundStatement());
}
Example #7
0
Decl *DeclSeq::insertDecl( const string &s,Type *t,int kind,ConstType *d ){
	if( findDecl( s ) ) return 0;
	decls.push_back( d_new Decl( s,t,kind,d ) );
	return decls.back();
}
Example #8
0
void Program()
{
   Decl();
   CompoundStatement();
   Gener(STOP);
}