org.jnetstream.lang.npl
Enum Targets

java.lang.Object
  extended by java.lang.Enum<Targets>
      extended by org.jnetstream.lang.npl.Targets
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Targets>, CodeTarget

public enum Targets
extends java.lang.Enum<Targets>
implements CodeTarget

Constants define type of output to produce from the compilation

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Enum Constant Summary
BPF_BINDING
          Compiler will generate BPF output containing BPF byte code compatible with BPF VM, BPF userland from Tcpdump and but not kernels.
BPF_FILTER
          Compiler will generate BPF output containing BPF byte code compatible with BPF VM, BPF userland from Tcpdump and most kernels.
BPF_INT_EXPRESSION
          Compiler will generate BPF output containing BPF byte code which implements the CodeExpression interface.
JASMIN_BINDING
          Compiler will generate assembled code suitable for current native 32-bit X86 processor platform on linux machine.
JASMIN_EXPRESSION
          Compiler will generate assembly code suitable for JASMIN assembler.
JASMIN_FILTER
          Compiler will generate assembly code suitable for JASMIN assembler.
JAVA_CODEC
          Compiler will generate JAVA source code suitable for javac compiler.
JAVA_PROTOCOL_IMPL
          Compiler will generate JAVA source code suitable for javac compiler.
JAVA_PROTOCOL_STUB
          Compiler will generate JAVA source code suitable for javac compiler.
JAVA_TABLE
          Compiler will generate JAVA source code suitable for javac compiler.
 
Method Summary
 java.io.File[] getTemplateFiles()
          Gets the list of template files that are grouped into a StringTemplateGroup by the compiler.
static Targets valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Targets[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BPF_FILTER

public static final Targets BPF_FILTER
Compiler will generate BPF output containing BPF byte code compatible with BPF VM, BPF userland from Tcpdump and most kernels.


BPF_BINDING

public static final Targets BPF_BINDING
Compiler will generate BPF output containing BPF byte code compatible with BPF VM, BPF userland from Tcpdump and but not kernels. The code will return -1 on failure or greater then 0 which is a bitwise index into the packet buffer of the start of the sink header.


BPF_INT_EXPRESSION

public static final Targets BPF_INT_EXPRESSION
Compiler will generate BPF output containing BPF byte code which implements the CodeExpression interface. Allows generic evaluation of any expression based on a packet byte buffer where integer result is expected.


JASMIN_FILTER

public static final Targets JASMIN_FILTER
Compiler will generate assembly code suitable for JASMIN assembler. The code will implement a Filter inteface.


JASMIN_BINDING

public static final Targets JASMIN_BINDING
Compiler will generate assembled code suitable for current native 32-bit X86 processor platform on linux machine.


JASMIN_EXPRESSION

public static final Targets JASMIN_EXPRESSION
Compiler will generate assembly code suitable for JASMIN assembler. The code will implement a CodeExpression inteface.


JAVA_PROTOCOL_STUB

public static final Targets JAVA_PROTOCOL_STUB
Compiler will generate JAVA source code suitable for javac compiler. The output will be a number of interfaces which provide STUB interface for the source NPL definition for all properties, fields and headers.


JAVA_PROTOCOL_IMPL

public static final Targets JAVA_PROTOCOL_IMPL
Compiler will generate JAVA source code suitable for javac compiler. The output will be a concrete class that provides implementing classes for all of the STUB interfaces.


JAVA_CODEC

public static final Targets JAVA_CODEC
Compiler will generate JAVA source code suitable for javac compiler. The output will be a concrete class that implements the HeaderCodec interface for encoding and decoding of packet buffers.


JAVA_TABLE

public static final Targets JAVA_TABLE
Compiler will generate JAVA source code suitable for javac compiler. The output will be a concrete enum class that defines all of the contants that were defined using NPL table statement. All the constants will be defined in java's enum table.

Method Detail

values

public static final Targets[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Targets c : Targets.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static Targets valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getTemplateFiles

public java.io.File[] getTemplateFiles()
Gets the list of template files that are grouped into a StringTemplateGroup by the compiler. Changing targets simply means providing a different set of templates. All the output language semantics are specified within the templates.

Specified by:
getTemplateFiles in interface CodeTarget
Returns:
array of template files where the order of determines the template hierachy with the the template file at index 0 beind the lowest super tempalte and the last file within the array being the must sub-template.
See Also:
org.jnetstream.lang.npl.NplCompiler.CodeTarget#getTemplateFiles()