Home My Page Projects Code Snippets Project Openings 3D graphics for Standard ML
Summary Activity SCM

SCM Repository

[sml3d] View of /trunk/sml3d/src/loaders/md5/md5mesh.grm
ViewVC logotype

View of /trunk/sml3d/src/loaders/md5/md5mesh.grm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 508 - (download) (annotate)
Wed Nov 11 22:59:26 2009 UTC (9 years, 10 months ago) by jhr
File size: 1239 byte(s)
  Added %header
(* md5mesh.grm
 *
 * COPYRIGHT (c) 2009 John Reppy (http://cs.uchicago.edu/~jhr)
 * All rights reserved.
 *
 * An ml-antlr specification for parsing MD5 mesh files.  A description
 * of the file format can be found at
 *
 *	http://www.modwiki.net/wiki/MD5MESH_(file_format)
 *)

%name MD5Mesh;

%header (
    functor MD5MeshParseFn(
	structure Lex : ANTLR_LEXER
	structure M : MD5_MESH_MAKE)
  )

%tokens
      : KW_numMeshes		("numMeshes")
      | KW_joints		("joints")
      | KW_mesh			("mesh")
      | KW_tri			("tri")
      | KW_weight		("weight")
      | KW_numtris		("numtris")
      | KW_numverts		("numverts")
      | KW_vert			("vert")
      | KW_numweights		("numweights")
      | KW_shader		("shader")
      ;

%import "md5common.grm";

%start File;

File
	: MD5Header "numJoints" INT "numMeshes" INT Joints Mesh+
	;

Joints
	: "joints" "{" Joint* "}"
	;

Joint
	: STR INT Float3 Float3
	;

Mesh
	: "mesh" "{" Shader Verts Tris Weights "}"
	;

Shader
	: "shader" STR
		(STR)
	;

Verts
	: "numverts" INT Vert*
	;

Vert
	: "vert" INT Float2 INT INT
	;

Tris
	: "numtris" INT Tri*
	;

Tri
	: "tri" INT INT INT INT
	;

Weights
	: "numweights" INT Weight*
	;

Weight
	: "weight" INT INT FLT Float3
	;

Float2
	: "(" FLT FLT ")"
	;


root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0