Package core

Class TokenizerResult

java.lang.Object
core.TokenizerResult

public class TokenizerResult extends Object
Holds the result of tokenizing a shell input string, including tokens and pipeline parts.
  • Field Details

    • tokens

      public List<String> tokens
      The list of tokens parsed from the input string.
    • redirectTarget

      public String redirectTarget
      The target file for standard output redirection (e.g., after '>' or '>>'), or null if not present.
    • stderrRedirectTarget

      public String stderrRedirectTarget
      The target file for standard error redirection (e.g., after '2>' or '2>>'), or null if not present.
    • isRedirect

      public boolean isRedirect
      True if the input contains standard output redirection ('>' or '>>').
    • isStderrRedirect

      public boolean isStderrRedirect
      True if the input contains standard error redirection ('2>' or '2>>').
    • isAppend

      public boolean isAppend
      True if the output redirection is in append mode ('>>').
    • isStderrAppend

      public boolean isStderrAppend
      True if the error redirection is in append mode ('2>>').
    • isPipeline

      public boolean isPipeline
      True if the input contains a pipeline ('|').
    • pipelineParts

      public List<TokenizerResult> pipelineParts
      The list of TokenizerResult objects for each part of a pipeline, or null if not a pipeline.
  • Constructor Details

    • TokenizerResult

      public TokenizerResult(List<String> tokens)
      Constructs a TokenizerResult with the given tokens.
      Parameters:
      tokens - The list of tokens.