BrightSide Workbench Full Report + Source Code
org.turro.parser.ParserMacro Class Reference
Inheritance diagram for org.turro.parser.ParserMacro:
Collaboration diagram for org.turro.parser.ParserMacro:

Public Member Functions

 ParserMacro (String macroName, int order)
 
String getMacroName ()
 
int getOrder ()
 
TreeSet< ParserParametergetParameters ()
 
ParserMacro addParameter (String name, boolean optional)
 
ParserMacro addParameter (String name, boolean optional, String defaultValue)
 
ParserMacro addParameter (String name, boolean optional, String defaultValue, boolean commaSeparated)
 
ParserMacro addPossibleValue (String value)
 
void copyParametersFrom (String macroName, ParserMacroSet macros)
 
int compareTo (ParserMacro o)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 28 of file ParserMacro.java.

Constructor & Destructor Documentation

◆ ParserMacro()

org.turro.parser.ParserMacro.ParserMacro ( String  macroName,
int  order 
)

Definition at line 34 of file ParserMacro.java.

34  {
35  this.macroName = macroName;
36  this.order = order;
37  }

Member Function Documentation

◆ addParameter() [1/3]

ParserMacro org.turro.parser.ParserMacro.addParameter ( String  name,
boolean  optional 
)

Definition at line 51 of file ParserMacro.java.

51  {
52  return addParameter(name, optional, null, false);
53  }
ParserMacro addParameter(String name, boolean optional)
Here is the caller graph for this function:

◆ addParameter() [2/3]

ParserMacro org.turro.parser.ParserMacro.addParameter ( String  name,
boolean  optional,
String  defaultValue 
)

Definition at line 55 of file ParserMacro.java.

55  {
56  return addParameter(name, optional, defaultValue, false);
57  }
Here is the call graph for this function:

◆ addParameter() [3/3]

ParserMacro org.turro.parser.ParserMacro.addParameter ( String  name,
boolean  optional,
String  defaultValue,
boolean  commaSeparated 
)

Definition at line 59 of file ParserMacro.java.

59  {
60  parameters.add(new ParserParameter(name, optional, defaultValue, parameters.size() + 1, commaSeparated));
61  return this;
62  }

◆ addPossibleValue()

ParserMacro org.turro.parser.ParserMacro.addPossibleValue ( String  value)

Definition at line 64 of file ParserMacro.java.

64  {
65  if(!parameters.isEmpty()) {
66  parameters.last().addPossibleValue(value);
67  }
68  return this;
69  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ compareTo()

int org.turro.parser.ParserMacro.compareTo ( ParserMacro  o)

Definition at line 81 of file ParserMacro.java.

81  {
82  int result = CompareUtil.compare(order, o.order);
83  if(result == 0) CompareUtil.compare(macroName, o.macroName);
84  return result;
85  }

◆ copyParametersFrom()

void org.turro.parser.ParserMacro.copyParametersFrom ( String  macroName,
ParserMacroSet  macros 
)

Definition at line 71 of file ParserMacro.java.

71  {
72  for(ParserMacro macro : macros) {
73  if(macro.getMacroName().equals(macroName)) {
74  macros.copyParametersTo(macro, this);
75  break;
76  }
77  }
78  }
ParserMacro(String macroName, int order)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMacroName()

String org.turro.parser.ParserMacro.getMacroName ( )

Definition at line 39 of file ParserMacro.java.

39  {
40  return macroName;
41  }

◆ getOrder()

int org.turro.parser.ParserMacro.getOrder ( )

Definition at line 43 of file ParserMacro.java.

43  {
44  return order;
45  }

◆ getParameters()

TreeSet<ParserParameter> org.turro.parser.ParserMacro.getParameters ( )

Definition at line 47 of file ParserMacro.java.

47  {
48  return parameters;
49  }
Here is the caller graph for this function:

The documentation for this class was generated from the following file: