/** * Create an EmitterDescriptor for the given methodName. This conmstructor creates a descriptor * that represents explicitly the types and size of the operands of the given emit* method. This * constructor encapsulate the logic to parse the given method name into the appropriate * explicit representation. */ EmitterDescriptor(String methodName, Class<?>[] argTypes) { StringTokenizer toks = new StringTokenizer(methodName, "_"); toks.nextElement(); // first element is emitXXX; args = new ArgumentType[toks.countTokens()]; ArgumentType size = null; int count = 0; int argTypeNum = 0; for (int i = 0; i < args.length; i++) { String cs = toks.nextToken(); ArgumentType code; if (argTypeNum < argTypes.length) { code = getEncoding(cs, argTypes[argTypeNum]); } else { code = getEncoding(cs, null); } argTypeNum += code.getParameters(); if (DEBUG) { System.err.println(methodName + "[" + i + "] is " + code + " for " + cs); } args[count] = code; count++; if (code.isSize()) { size = code; count--; } } this.size = size; this.count = count; }