本文整理汇总了Java中board.Communication.SpecctraParserInfo类的典型用法代码示例。如果您正苦于以下问题:Java SpecctraParserInfo类的具体用法?Java SpecctraParserInfo怎么用?Java SpecctraParserInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SpecctraParserInfo类属于board.Communication包,在下文中一共展示了SpecctraParserInfo类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read_write_solution
import board.Communication.SpecctraParserInfo; //导入依赖的package包/类
private static SpecctraParserInfo.WriteResolution read_write_solution(ReadScopeParameter p_par)
{
try
{
Object next_token = p_par.scanner.next_token();
if (!(next_token instanceof String))
{
System.out.println("Parser.read_write_solution: string expected");
return null;
}
String resolution_string = (String) next_token;
next_token = p_par.scanner.next_token();
if (!(next_token instanceof Integer))
{
System.out.println("Parser.read_write_solution: integer expected expected");
return null;
}
int resolution_value = (Integer) next_token;
next_token = p_par.scanner.next_token();
if (next_token != Keyword.CLOSED_BRACKET)
{
System.out.println("Parser.read_write_solution: closing_bracket expected");
return null;
}
return new SpecctraParserInfo.WriteResolution(resolution_string, resolution_value);
}
catch (java.io.IOException e)
{
System.out.println("Parser.read_write_solution: IO error scanning file");
return null;
}
}
示例2: write_scope
import board.Communication.SpecctraParserInfo; //导入依赖的package包/类
/**
* p_reduced is true if the scope is written to a session file.
*/
public static void write_scope(datastructures.IndentFileWriter p_file, SpecctraParserInfo p_parser_info,
datastructures.IdentifierType p_identifier_type, boolean p_reduced) throws java.io.IOException
{
p_file.start_scope();
p_file.write("parser");
if (!p_reduced)
{
p_file.new_line();
p_file.write("(string_quote ");
p_file.write(p_parser_info.string_quote);
p_file.write(")");
p_file.new_line();
p_file.write("(space_in_quoted_tokens on)");
}
if (p_parser_info.host_cad != null)
{
p_file.new_line();
p_file.write("(host_cad ");
p_identifier_type.write(p_parser_info.host_cad, p_file);
p_file.write(")");
}
if (p_parser_info.host_version != null)
{
p_file.new_line();
p_file.write("(host_version ");
p_identifier_type.write(p_parser_info.host_version, p_file);
p_file.write(")");
}
if (p_parser_info.constants != null)
{
for (String[] curr_constant : p_parser_info.constants)
{
p_file.new_line();
p_file.write("(constant ");
for (int i = 0; i < curr_constant.length; ++i)
{
p_identifier_type.write(curr_constant[i], p_file);
p_file.write(" ");
}
p_file.write(")");
}
}
if (p_parser_info.write_resolution != null)
{
p_file.new_line();
p_file.write("(write_resolution ");
p_file.write(p_parser_info.write_resolution.char_name.substring(0, 1));
p_file.write(" ");
Integer positive_int = p_parser_info.write_resolution.positive_int;
p_file.write(positive_int.toString());
p_file.write(")");
}
if (!p_reduced)
{
p_file.new_line();
p_file.write("(generated_by_freeroute)");
}
p_file.end_scope();
}