Logo Search packages:      
Sourcecode: jmk version File versions  Download package

void edu::neu::ccs::jmk::Rule::merge ( Rule[]  addedPrerequisites,
Command[]  commands,
int  lineNumber 
) [inline, package]

Merges prerequisites and commands into a rule. Prerequisites are added to the end of the current list of prerequisites. The commands are added if the rule has no other commands, otherwise they are ignored.

Parameters:
addedPrerequisites prereqs to be added
commands new commands for consideration
lineNumber the position of the information in the makefile

Definition at line 88 of file Rule.java.

Referenced by edu::neu::ccs::jmk::Make::addRule(), and tryPattern().

  {
    if (prerequisites.length == 0)
      prerequisites = addedPrerequisites;
    else if (addedPrerequisites.length > 0) {
      Rule[] old = prerequisites;
      int len = old.length;
      prerequisites = new Rule[len + addedPrerequisites.length];
      for (int i = 0; i < len; i++)
      prerequisites[i] = old[i];
      for (int i = 0; i < addedPrerequisites.length; i++)
      prerequisites[len + i] = addedPrerequisites[i];
    }
    if (this.commands.length == 0)
      this.commands = commands;
    if (this.lineNumber == -1)
      this.lineNumber = lineNumber;
  }


Generated by  Doxygen 1.6.0   Back to index