org.infinispan.ppg.generator.ByteLiteral Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infinispan-protocol-parser-generator-maven-plugin
Show all versions of infinispan-protocol-parser-generator-maven-plugin
Generates an io.netty.handler.codec.ByteToMessageDecoder based on a grammar
package org.infinispan.ppg.generator;
import java.util.List;
import java.util.Set;
class ByteLiteral implements Element {
private final int value;
public ByteLiteral(int value) {
this.value = value;
}
@Override
public String toString() {
return String.format("0x%02X", value);
}
@Override
public void addReferences(Set references) {
}
@Override
public Machine.State addStates(Machine.State prev, Machine.State target, Machine machine, Grammar grammar, List ruleStack) {
return prev.requireReadByte(String.valueOf(value), target);
}
@Override
public String analyzeType(Grammar grammar) {
return "byte";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy