• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java StringHolder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.omg.CORBA.StringHolder的典型用法代码示例。如果您正苦于以下问题:Java StringHolder类的具体用法?Java StringHolder怎么用?Java StringHolder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



StringHolder类属于org.omg.CORBA包,在下文中一共展示了StringHolder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: parseApplicationHandlerDefinitionSignature

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
public static boolean parseApplicationHandlerDefinitionSignature(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "parseApplicationHandlerDefinitionSignature")) return false;
  boolean r;
  //application handled definition in script only makes sense inside <using terms of> statement
  if (b.getUserData(IS_PARSING_USING_TERMS_FROM_STATEMENT) != Boolean.TRUE || b.getUserData(PARSING_TELL_COMPOUND_STATEMENT) == Boolean.TRUE) return false;

  StringHolder parsedCommandName = new StringHolder();
  String toldApplicationName = getTargetApplicationName(b);
  PsiBuilder.Marker m2 = enter_section_(b, l, _COLLAPSE_, "<parse Application Handler Definition");
  r = parseDictionaryCommandNameInner(b, l + 1, parsedCommandName, toldApplicationName, true, null);
  exit_section_(b, l, m2, DICTIONARY_COMMAND_NAME, r, false, null);

  if (!r) return false;
  // TODO: 06/12/15 may be try to avoid creating PSI here!..
  List<AppleScriptCommand> allCommandsWithName = getAllCommandsWithName(b, parsedCommandName.value, toldApplicationName, false, null);

  for (AppleScriptCommand command : allCommandsWithName) {
    r = parseParametersForCommand(b, l + 1, command);//custom parsing here
    if (r) {
      break;
    }
  }
  boolean incompleteHandlerCall = !r && allCommandsWithName.size() > 0 && (b.getTokenType() == NLS || b.eof());
  return r || incompleteHandlerCall;

}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:27,代码来源:AppleScriptGeneratedParserUtil.java


示例2: parseExpression

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/**
   * If inside tell (only in a tell?) compound statement - first check it's terms
   */
  public static boolean parseExpression(PsiBuilder b, int l, String dictionaryTermToken, Parser expression) {
    if (!recursion_guard_(b, l, "parseExpression")) return false;
    if (!nextTokenIsFast(b, dictionaryTermToken)) return false;
    boolean r;

    //check application terms first
    if (b.getUserData(PARSING_TELL_COMPOUND_STATEMENT) == Boolean.TRUE) {
      String toldAppName = peekTargetApplicationName(b);
      if (!StringUtil.isEmpty(toldAppName)) {
        StringHolder parsedName = new StringHolder();
        PsiBuilder.Marker mComName = enter_section_(b, l, _AND_, "<parse Expression>");
        r = parseCommandNameForApplication(b, l + 1, parsedName, toldAppName, true);
        exit_section_(b, l, mComName, null, r, false, null);
        if (r) return false;
        if (ParsableScriptSuiteRegistryHelper.isPropertyWithPrefixExist(toldAppName, dictionaryTermToken)) {
          return false;
//          PsiBuilder.Marker m = enter_section_(b, l, _AND_, null, "<dictionary constant>");
//          r = parseDictionaryConstant(b, l + 1);
//          exit_section_(b, l, m, r, false, null);
//          if (r) return false;
        }
      }
    }
    return expression.parse(b, l + 1);
  }
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:29,代码来源:AppleScriptGeneratedParserUtil.java


示例3: parseCommandParameterSelector

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
private static boolean parseCommandParameterSelector(PsiBuilder b, int l, AppleScriptCommand command,
                                                     StringHolder parsedParameterSelector) {
  if (!recursion_guard_(b, l, "parseCommandParameterSelector")) return false;
  boolean r = false;
  PsiBuilder.Marker m = enter_section_(b, l, _NONE_, "<parse Command Parameter Selector>");//todo check this _AND_
  parsedParameterSelector.value = b.getTokenText() == null ? "" : b.getTokenText();
  while (!b.eof() && b.getTokenType() != NLS && b.getTokenType() != COMMENT) {
    b.advanceLexer();
    if (command.getParameterByName(parsedParameterSelector.value) != null) {
      r = true;
      break;
    }
    parsedParameterSelector.value += " " + b.getTokenText();
  }
  exit_section_(b, l, m, COMMAND_PARAMETER_SELECTOR, r, false, null);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:18,代码来源:AppleScriptGeneratedParserUtil.java


示例4: parseStdLibCommandName

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
private static boolean parseStdLibCommandName(PsiBuilder b, int l, StringHolder parsedName) {
  if (!recursion_guard_(b, l, "parseStdLibCommandName")) return false;
  boolean r = false;
  parsedName.value = "";
  parsedName.value = b.getTokenText() == null ? "" : b.getTokenText();
  PsiBuilder.Marker m = enter_section_(b);
  boolean commandWithPrefixExists = ParsableScriptSuiteRegistryHelper.isStdCommandWithPrefixExist(parsedName.value);
  String nextTokenText = parsedName.value;
  while (b.getTokenText() != null && commandWithPrefixExists) {
    b.advanceLexer(); //advance lexer in any case
    nextTokenText += " " + b.getTokenText();
    commandWithPrefixExists = ParsableScriptSuiteRegistryHelper.isStdCommandWithPrefixExist(nextTokenText);
    if (commandWithPrefixExists) {
      parsedName.value = nextTokenText;
    } else if (ParsableScriptSuiteRegistryHelper.isStdCommand(parsedName.value)) {
      r = true;
      break;
    }
  }
  exit_section_(b, m, null, r);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:23,代码来源:AppleScriptGeneratedParserUtil.java


示例5: parseDictionaryCommandName

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
public static boolean parseDictionaryCommandName(PsiBuilder b, int l) {
  boolean r;
  if (nextTokenIs(b, NLS)) {
    return false;
  }
  StringHolder parsedCommandName = new StringHolder();
  String toldApplicationName = getTargetApplicationName(b);
  boolean areThereUseStatements = b.getUserData(WAS_USE_STATEMENT_USED) == Boolean.TRUE;
  Set<String> applicationsToImport = null;
  if (areThereUseStatements) {
    applicationsToImport = b.getUserData(USED_APPLICATION_NAMES);
  }
  PsiBuilder.Marker m = enter_section_(b, l, _COLLAPSE_, "<parse ApplicationDictionary Command Name>");
  r = parseDictionaryCommandNameInner(b, l + 1, parsedCommandName, toldApplicationName, areThereUseStatements, applicationsToImport);
  exit_section_(b, l, m, DICTIONARY_COMMAND_NAME, r, false, null);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:18,代码来源:AppleScriptGeneratedParserUtil.java


示例6: parseDictionaryClassName

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/**
 * @param b                     {@link PsiBuilder}
 * @param l                     level deep
 * @param isPluralForm          if parsing plural form of a class name
 * @param checkForUseStatements parser rule for the check if there are use statements in the script
 * @return true in case rule matches, false otherwise
 */
public static boolean parseDictionaryClassName(PsiBuilder b, int l, final boolean isPluralForm, @NotNull Parser checkForUseStatements) {
  if (!recursion_guard_(b, l, "parseDictionaryClassName")) return false;
  boolean r;
  final String s = b.getTokenText();
  if (s == null || s.length() == 0 || !AppleScriptNames.isIdentifierStart(s.charAt(0))) return false;
  final String toldApplicationName = getTargetApplicationName(b);
  final boolean areThereUseStatements = checkForUseStatements.parse(b, l + 1);
  Set<String> applicationsToImportFrom = null;
  if (areThereUseStatements) {
    applicationsToImportFrom = b.getUserData(USED_APPLICATION_NAMES);
  }
  final StringHolder currentTokenText = new StringHolder();
  currentTokenText.value = s;
  r = parseDictionaryClassName(b, l + 1, currentTokenText, isPluralForm, toldApplicationName, areThereUseStatements, applicationsToImportFrom);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:24,代码来源:AppleScriptGeneratedParserUtil.java


示例7: tryToParseStdProperty

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/**
 * @param b {@link PsiBuilder}
 * @param l level deep
 * @return true if parsed token(s) is the property of the scripting additions library
 */
private static boolean tryToParseStdProperty(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "tryToParseStdProperty")) return false;
  boolean r = false;
  PsiBuilder.Marker m = enter_section_(b);
  StringHolder currentTokenText = new StringHolder();
  currentTokenText.value = b.getTokenText() == null ? "" : b.getTokenText();
  boolean propertyWithPrefixExists = ParsableScriptSuiteRegistryHelper
          .isStdPropertyWithPrefixExist(currentTokenText.value);
  String nextTokenText = currentTokenText.value;
  while (b.getTokenText() != null && propertyWithPrefixExists) {
    b.advanceLexer(); //advance lexer in any case
    nextTokenText += " " + b.getTokenText();
    propertyWithPrefixExists = ParsableScriptSuiteRegistryHelper.isStdPropertyWithPrefixExist(nextTokenText);
    if (propertyWithPrefixExists) {
      currentTokenText.value = nextTokenText;
    } else if (ParsableScriptSuiteRegistryHelper.isStdProperty(currentTokenText.value)) {
      r = true;
      break;
    }
  }
  exit_section_(b, m, null, r);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:29,代码来源:AppleScriptGeneratedParserUtil.java


示例8: tryToParseApplicationProperty

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/**
 * @param b               {@link PsiBuilder}
 * @param l               level deep
 * @param applicationName name of the application
 * @return true if parsed token(s) is the property of the specified application
 */
private static boolean tryToParseApplicationProperty(PsiBuilder b, int l, @NotNull String applicationName) {
  if (!recursion_guard_(b, l, "tryToParseApplicationProperty")) return false;
  boolean r = false;
  PsiBuilder.Marker m = enter_section_(b);
  StringHolder currentTokenText = new StringHolder();
  currentTokenText.value = b.getTokenText() == null ? "" : b.getTokenText();
  boolean propertyWithPrefixExist = ParsableScriptSuiteRegistryHelper.isPropertyWithPrefixExist(applicationName,
          currentTokenText.value);
  //find the longest lexeme
  String nextTokenText = currentTokenText.value;
  while (b.getTokenText() != null && propertyWithPrefixExist) {
    b.advanceLexer(); //advance lexer in any case
    nextTokenText += " " + b.getTokenText();
    propertyWithPrefixExist = ParsableScriptSuiteRegistryHelper.isPropertyWithPrefixExist(applicationName,
            nextTokenText);
    if (propertyWithPrefixExist) {
      currentTokenText.value = nextTokenText;
    } else if (ParsableScriptSuiteRegistryHelper.isApplicationProperty(applicationName, currentTokenText.value)) {
      r = true;
      break;
    }
  }
  exit_section_(b, m, null, r);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:32,代码来源:AppleScriptGeneratedParserUtil.java


示例9: passSimple

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/**
 * Accept and return parameters, having various types.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  System.out.println("SERVER: ***** Test passing multiple parameters");
  System.out.println("SERVER:   Received:");
  System.out.println("SERVER:   octet " + an_octet.value);
  System.out.println("SERVER:   short " + a_short.value);
  System.out.println("SERVER:   string " + a_string.value);

  // Returning incremented values.
  an_octet.value++;
  a_short.value++;

  // OUT parameter, return only.
  a_double.value = 1;
  a_string.value += " [return]";
  return 452572;
}
 
开发者ID:vilie,项目名称:javify,代码行数:23,代码来源:DemoServant.java


示例10: testParameters

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/**
 * Test passing multiple parameters in both directions.
 */
public void testParameters()
{
  System.out.println("***** Pass multiple parameters.");

  // Holder classes are required to simulate passing
  // "by reference" (modification is returned back to the server).
  ByteHolder a_byte = new ByteHolder((byte) 0);
  ShortHolder a_short = new ShortHolder((short) 3);
  StringHolder a_string = new StringHolder("[string 4]");

  // This is an 'out' parameter; the value must not be passed to servant.
  DoubleHolder a_double = new DoubleHolder(56.789);

  int returned = object.passSimple(a_byte, 2, a_short, a_string, a_double);

  System.out.println("  Returned value " + returned);
  System.out.println("  Returned parameters: ");
  System.out.println("  octet " + a_byte.value);
  System.out.println("  short " + a_short.value);
  System.out.println("  string '" + a_string.value+"'");
  System.out.println("  double " + a_double.value);
}
 
开发者ID:vilie,项目名称:javify,代码行数:26,代码来源:DirectTest.java


示例11: parseDictionaryCommandNameInner

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/**
 * @param b                        {@link PsiBuilder}
 * @param l                        level deep
 * @param parsedName               holder for parsed command name string
 * @param toldApplicationName      name of the application to which all messages are sent by default (it's
 *                                 terminology is queried first)
 * @param areThereUseStatements    if there are use statements in script
 * @param applicationsToImportFrom list of application names to use for dictionary terms lookup
 * @return true if rule matches, false otherwise
 */
private static boolean parseDictionaryCommandNameInner(PsiBuilder b, int l,
                                                       @NotNull StringHolder parsedName,
                                                       @NotNull String toldApplicationName,
                                                       boolean areThereUseStatements,
                                                       @Nullable Set<String> applicationsToImportFrom) {
  if (!recursion_guard_(b, l, "parseDictionaryCommandNameInner")) return false;
  boolean r;
  parsedName.value = "";
  // TODO: 12/1/2015 could be command with name which does not exist in this target app but in stanradr additions or
  // CocoaStandard dictionary or in use application dictionary. search all here?? to find the longest dictionary term

  //if there are use statements, do not check terms from scripting additions library (they should be explicitly imported in this case)
  boolean checkStdLib = !areThereUseStatements || applicationsToImportFrom == null
          || applicationsToImportFrom.contains(ApplicationDictionary.SCRIPTING_ADDITIONS_LIBRARY);
  ParsableScriptSuiteRegistryHelper.ensureKnownApplicationInitialized(toldApplicationName);
  r = parseCommandNameForApplication(b, l + 1, parsedName, toldApplicationName, checkStdLib);
  if (r) return true;
  if (areThereUseStatements) {
    if (applicationsToImportFrom != null && !applicationsToImportFrom.isEmpty()) {
      for (String appName : applicationsToImportFrom) {
        //in case of SCRIPTING_ADDITIONS 'StandardAdditions' app name is added to app names import list
        ParsableScriptSuiteRegistryHelper.ensureKnownApplicationInitialized(appName);
        r = parseCommandNameForApplication(b, l + 1, parsedName, appName, false);
        if (r) return true;
      }
    }
  }
  if (checkStdLib) {
    r = parseStdLibCommandName(b, l + 1, parsedName);
    if (r) return true;
  }
  // Could be command from Cocoa Standard library which was not yet checked, because applicationName == ScriptingAdditions.
  // The could happen when parsing <using terms from scripting additions> stms
  r = parseCommandNameForApplication(b, l + 1, parsedName, ApplicationDictionary.COCOA_STANDARD_LIBRARY, checkStdLib);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:47,代码来源:AppleScriptGeneratedParserUtil.java


示例12: parseCommandHandlerCallExpression

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/**
 * <<< COMMAND_HANDLER_CALL >>>
 */
// commandName commandParameters?
public static boolean parseCommandHandlerCallExpression(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "parseCommandHandlerCallExpression")) return false;
  boolean r;

  if (nextTokenIs(b, NLS)) return false;
  final String s = b.getTokenText();

  if (s == null || s.length() == 0 || !AppleScriptNames.isIdentifierStart(s.charAt(0))) return false;
  StringHolder parsedCommandName = new StringHolder();
  //get current application name to which messages will be sent in the current block
  String toldApplicationName = getTargetApplicationName(b);
  //if there are <use statements> present in the script
  boolean areThereUseStatements = b.getUserData(WAS_USE_STATEMENT_USED) == Boolean.TRUE;
  Set<String> applicationsToImport = null;
  if (areThereUseStatements) {
    //adding list of application names from use statements
    applicationsToImport = b.getUserData(USED_APPLICATION_NAMES);
  }
  PsiBuilder.Marker m2 = enter_section_(b, l, _COLLAPSE_, "<parse Command Handler Call Expression>");
  // TODO: 19/12/15 need to parse command name together with parameters for each possible application in order to be
  // able to parse the longest possible application name ('open for access' std lib vs 'open' from application dict)
  r = parseDictionaryCommandNameInner(b, l + 1, parsedCommandName, toldApplicationName, areThereUseStatements, applicationsToImport);
  exit_section_(b, l, m2, DICTIONARY_COMMAND_NAME, r, false, null);

  if (!r) return false;
  // TODO: 06/12/15 may be try to avoid creating PSI here!..
  List<AppleScriptCommand> allCommandsWithName = getAllCommandsWithName(b, parsedCommandName.value, toldApplicationName, areThereUseStatements,
          applicationsToImport);

  for (AppleScriptCommand command : allCommandsWithName) {
    r = parseParametersForCommand(b, l + 1, command);
    if (r) {
      break;
    }
  }
  boolean incompleteHandlerCall = !r && allCommandsWithName.size() > 0 && (b.getTokenType() == NLS || b.eof());
  return r || incompleteHandlerCall;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:43,代码来源:AppleScriptGeneratedParserUtil.java


示例13: parseParameterForCommand

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
private static boolean parseParameterForCommand(PsiBuilder b, int l, AppleScriptCommand command,
                                                StringHolder parsedParameterSelector, boolean givenForm, boolean
                                                        first) {
  if (!recursion_guard_(b, l, "parseParameterForCommand")) return false;
  boolean r;
  PsiBuilder.Marker m = enter_section_(b, l, _NONE_, "<parse Parameter For Command>");//todo check here if it works
  r = parseGivenParameter(b, l + 1, command, parsedParameterSelector, givenForm, first);
  //todo and here exit and enter once again if it is true??
  if (!r) r = parseBooleanParameter(b, l + 1, command, parsedParameterSelector);

  exit_section_(b, l, m, COMMAND_PARAMETER, r, false, null);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:14,代码来源:AppleScriptGeneratedParserUtil.java


示例14: parseBooleanParameter

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
private static boolean parseBooleanParameter(PsiBuilder b, int l, AppleScriptCommand command, StringHolder
        parsedParameterSelector) {
  if (!recursion_guard_(b, l, "parseBooleanParameter")) return false;
  boolean r;
  //need to rollback with/without if there is no match
  PsiBuilder.Marker m = enter_section_(b, l, _NONE_, "<parse Boolean Parameter>");
  b.putUserData(PARSING_COMMAND_HANDLER_BOOLEAN_PARAMETER, true);
  r = consumeToken(b, WITH);
  if (!r) r = consumeToken(b, WITHOUT);
  if (!r) r = consumeToken(b, LAND); //for cases like: '...with regexp and all occurrences without case sensitive'
  r = r && parseCommandParameterSelector(b, l + 1, command, parsedParameterSelector);
  exit_section_(b, l, m, null, r, false, null);
  b.putUserData(PARSING_COMMAND_HANDLER_BOOLEAN_PARAMETER, false);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:16,代码来源:AppleScriptGeneratedParserUtil.java


示例15: parseGivenParameter

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
private static boolean parseGivenParameter(PsiBuilder b, int l, AppleScriptCommand command,
                                           StringHolder parsedParameterSelector, boolean givenForm, boolean first) {
  if (!recursion_guard_(b, l, "parseGivenParameter")) return false;
  PsiBuilder.Marker m = enter_section_(b, l, _NONE_, "<parse Given Parameter>");
  boolean r = !givenForm || first || consumeToken(b, COMMA);//if it is a given form and not the first parameter ->
  // should be comma
  r = r && parseCommandParameterSelector(b, l + 1, command, parsedParameterSelector);
  final CommandParameter parameterDefinition = command.getParameterByName(parsedParameterSelector.value);
  //todo: parameter value expression could be incorrectly parsed and needed to be rolled backed (__AND__ modifier?)
  //as in example: mount volume "" in AppleTalk zone ""  (in - parsed as range ref form)
  if (givenForm) r = consumeToken(b, COLON);
  r = r && parseCommandParameterValue(b, l + 1, parameterDefinition);
  exit_section_(b, l, m, null, r, false, null);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:16,代码来源:AppleScriptGeneratedParserUtil.java


示例16: parseDictionaryConstant

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
public static boolean parseDictionaryConstant(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "parseDictionaryConstant")) return false;
  boolean r, propertyOrClassExists = false;
  String toldApplicationName = getTargetApplicationName(b);
  //TODO: to think how to better handle such situations?
  // (if there are too many constants defined -> lead to many incorrect parsing errors like
  // 'end' tell/repeat etc is not detected
  // dictionary constant could appear only if we are inside dictionary command call
  boolean insideExpression = (b.getUserData(PARSING_COMMAND_HANDLER_CALL_PARAMETERS) == Boolean.TRUE
          || b.getUserData(PARSING_COMMAND_ASSIGNMENT_STATEMENT) == Boolean.TRUE)
          || b.getUserData(PARSING_LITERAL_EXPRESSION) == Boolean.TRUE;
  if (!ApplicationDictionary.COCOA_STANDARD_LIBRARY.equals(toldApplicationName) && !insideExpression)//only inside 
    // tell statements?
    return false;

  final StringHolder currentTokenText = new StringHolder();
  currentTokenText.value = "";
  boolean areThereUseStatements = b.getUserData(WAS_USE_STATEMENT_USED) == Boolean.TRUE;
  Set<String> applicationsToImportFrom = null;
  if (areThereUseStatements) {
    applicationsToImportFrom = b.getUserData(USED_APPLICATION_NAMES);
  }
  r = tryToParseApplicationConstant(b, l + 1, toldApplicationName);
  if (r) return true;
  if (areThereUseStatements && insideExpression) {
    if (applicationsToImportFrom != null && !applicationsToImportFrom.isEmpty()) {
      for (String appName : applicationsToImportFrom) {
        r = tryToParseApplicationConstant(b, l + 1, appName);
        if (r) return true;
      }
    }
  } else {
    r = tryToParseStdConstant(b, l + 1);
    if (r) return true;
    r = tryToParseApplicationConstant(b, l + 1, ApplicationDictionary.COCOA_STANDARD_LIBRARY);
    if (r) return true;
  }
  return false;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:40,代码来源:AppleScriptGeneratedParserUtil.java


示例17: tryToParseStdConstant

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
private static boolean tryToParseStdConstant(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "tryToParseStdConstant")) return false;
  StringHolder currentTokenText = new StringHolder();
  currentTokenText.value = b.getTokenText() == null ? "" : b.getTokenText();
  boolean r = false, propertyOrClassExists = false, constantWithPrefixExists = ParsableScriptSuiteRegistryHelper
          .isStdConstantWithPrefixExist(currentTokenText.value);
  String nextTokenText = currentTokenText.value;
  PsiBuilder.Marker m = enter_section_(b);
  while (b.getTokenText() != null && constantWithPrefixExists) {
    b.advanceLexer();
    nextTokenText += " " + b.getTokenText();
    constantWithPrefixExists = ParsableScriptSuiteRegistryHelper.isStdConstantWithPrefixExist(nextTokenText);
    if (constantWithPrefixExists) {
      currentTokenText.value = nextTokenText;
    } else if (ParsableScriptSuiteRegistryHelper.isStdConstant(currentTokenText.value)) {
      r = true;
      break;
    }
  }
  if (r) {
    // grammar allows className and propertyName as primaryExpression, so we should match the longest token between
    // className or propertyName tokens. We check and return false if the property or class with the longer name
    // exists, as it will be parsed later
    currentTokenText.value += " " + b.getTokenText();
    propertyOrClassExists = ParsableScriptSuiteRegistryHelper
            .isStdPropertyWithPrefixExist(currentTokenText.value) ||
            ParsableScriptSuiteRegistryHelper
                    .isStdClassWithPrefixExist(currentTokenText.value);
  }
  r = r && !propertyOrClassExists;
  exit_section_(b, m, null, r);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:34,代码来源:AppleScriptGeneratedParserUtil.java


示例18: tryToParseApplicationConstant

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
private static boolean tryToParseApplicationConstant(PsiBuilder b, int l, @NotNull String applicationName) {
  if (!recursion_guard_(b, l, "tryToParseApplicationConstant")) return false;
  StringHolder currentTokenText = new StringHolder();
  currentTokenText.value = b.getTokenText() == null ? "" : b.getTokenText();
  boolean r = false, propertyOrClassExists = false, constantWithPrefixExists = ParsableScriptSuiteRegistryHelper
          .isConstantWithPrefixExist(applicationName, currentTokenText.value);
  String nextTokenText = currentTokenText.value;
  PsiBuilder.Marker m = enter_section_(b);
  while (b.getTokenText() != null && constantWithPrefixExists) {
    b.advanceLexer();
    nextTokenText += " " + b.getTokenText();
    constantWithPrefixExists = ParsableScriptSuiteRegistryHelper
            .isConstantWithPrefixExist(applicationName, nextTokenText);
    if (constantWithPrefixExists) {
      currentTokenText.value = nextTokenText;
    } else if (ParsableScriptSuiteRegistryHelper.isApplicationConstant(applicationName, currentTokenText.value)) {
      r = true;
      break;
    }
  }
  if (r) {
    // grammar allows className and propertyName as primaryExpression, so we should match the longest token between
    // className or propertyName tokens. We check and return false if the property or class with the longer name
    // exists, as it will be parsed later
    propertyOrClassExists = ParsableScriptSuiteRegistryHelper
            .isPropertyWithPrefixExist(applicationName, currentTokenText.value) ||
            ParsableScriptSuiteRegistryHelper
                    .isClassWithPrefixExist(applicationName, currentTokenText.value);
    if (propertyOrClassExists) {
      currentTokenText.value += " " + b.getTokenText();
      propertyOrClassExists = ParsableScriptSuiteRegistryHelper
              .isPropertyWithPrefixExist(applicationName, currentTokenText.value) ||
              ParsableScriptSuiteRegistryHelper
                      .isClassWithPrefixExist(applicationName, currentTokenText.value);
    }
  }
  r = r && !propertyOrClassExists;
  exit_section_(b, m, null, r);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:41,代码来源:AppleScriptGeneratedParserUtil.java


示例19: get_string

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/** {@inheritDoc} */
public String get_string() throws TypeMismatch
{
  try
    {
      return ((StringHolder) holder).value;
    }
  catch (ClassCastException cex)
    {
      TypeMismatch m = new TypeMismatch();
      m.initCause(cex);
      throw m;
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:15,代码来源:gnuDynAny.java


示例20: extract_string

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/** {@inheritDoc} */
public String extract_string()
                      throws BAD_OPERATION
{
  check(TCKind._tk_string);
  return ((StringHolder) has).value;
}
 
开发者ID:vilie,项目名称:javify,代码行数:8,代码来源:gnuAny.java



注:本文中的org.omg.CORBA.StringHolder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SizeT类代码示例发布时间:2022-05-22
下一篇:
Java TextChannel类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap