Skip to content

Package net.minecraft.util.parsing.packrat

Part 1/1


Atom

  • Full name: net.minecraft.util.parsing.packrat.Atom
  • Package: net.minecraft.util.parsing.packrat
  • Source: commonnet/minecraft/util/parsing/packrat/Atom.java
  • Type: record
  • Modifiers: public

net.minecraft.util.parsing.packrat.Atom#of(String)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Atom.java:9
  • Modifiers: public static
  • Return: Atom<T>

คืออะไร

ดำเนินการ of ตาม implementation ของ Atom

ทำงานยังไง

สร้างออบเจ็กต์: Atom<>. คืนค่า: new Atom<>(string).

Parameters

  • String string

ตัวอย่างใช้งาน

Atom<T> result = Atom.of("value");

net.minecraft.util.parsing.packrat.Atom#toString()

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Atom.java:4
  • Modifiers: public
  • Return: String

คืออะไร

ดำเนินการ toString ตาม implementation ของ Atom

ทำงานยังไง

คืนค่า: "<" + this.name + ">".

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Atom instance = ...;
String result = instance.toString();

Control

  • Full name: net.minecraft.util.parsing.packrat.Control
  • Package: net.minecraft.util.parsing.packrat
  • Source: commonnet/minecraft/util/parsing/packrat/Control.java
  • Type: interface
  • Modifiers: public

net.minecraft.util.parsing.packrat.Control#cut()

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Control.java:6
  • Modifiers: ``
  • Return: void

คืออะไร

ดำเนินการ cut ตาม implementation ของ Control

ทำงานยังไง

ไม่มี body ใน source declaration นี้

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Control instance = ...;
instance.cut();

Dictionary

  • Full name: net.minecraft.util.parsing.packrat.Dictionary
  • Package: net.minecraft.util.parsing.packrat
  • Source: commonnet/minecraft/util/parsing/packrat/Dictionary.java
  • Type: class
  • Modifiers: public

net.minecraft.util.parsing.packrat.Dictionary#get(Atom<T>)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Dictionary.java:25
  • Modifiers: public
  • Return: Rule<S, T>

คืออะไร

อ่านค่า get

ทำงานยังไง

คืนค่า: (Rule<S, T>)this.terms.get(atom).

Parameters

  • Atom<T> atom

ตัวอย่างใช้งาน

Dictionary instance = ...;
Atom<T> atom = ...;
Rule<S, T> result = instance.get(atom);

net.minecraft.util.parsing.packrat.Dictionary#put(Atom<T>,Rule<S, T>)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Dictionary.java:10
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ put ตาม implementation ของ Dictionary

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: putIfAbsent(). สร้างออบเจ็กต์: IllegalArgumentException.

Parameters

  • Atom<T> atom
  • Rule<S, T> rule

ตัวอย่างใช้งาน

Dictionary instance = ...;
Atom<T> atom = ...;
Rule<S, T> rule = ...;
instance.put(atom, rule);

net.minecraft.util.parsing.packrat.Dictionary#put(Atom<T>,Term<S>,Rule.RuleAction<S, T>)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Dictionary.java:17
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ put ตาม implementation ของ Dictionary

ทำงานยังไง

เรียกต่อ: fromTerm().

Parameters

  • Atom<T> atom
  • Term<S> term
  • Rule.RuleAction<S, T> ruleAction

ตัวอย่างใช้งาน

Dictionary instance = ...;
Atom<T> atom = ...;
Term<S> term = ...;
Rule.RuleAction<S, T> ruleAction = ...;
instance.put(atom, term, ruleAction);

net.minecraft.util.parsing.packrat.Dictionary#put(Atom<T>,Term<S>,Rule.SimpleRuleAction<T>)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Dictionary.java:21
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ put ตาม implementation ของ Dictionary

ทำงานยังไง

เรียกต่อ: fromTerm().

Parameters

  • Atom<T> atom
  • Term<S> term
  • Rule.SimpleRuleAction<T> simpleRuleAction

ตัวอย่างใช้งาน

Dictionary instance = ...;
Atom<T> atom = ...;
Term<S> term = ...;
Rule.SimpleRuleAction<T> simpleRuleAction = ...;
instance.put(atom, term, simpleRuleAction);

ErrorCollector

  • Full name: net.minecraft.util.parsing.packrat.ErrorCollector
  • Package: net.minecraft.util.parsing.packrat
  • Source: commonnet/minecraft/util/parsing/packrat/ErrorCollector.java
  • Type: interface
  • Modifiers: public

net.minecraft.util.parsing.packrat.ErrorCollector#finish(int)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/ErrorCollector.java:13
  • Modifiers: ``
  • Return: void

คืออะไร

ดำเนินการ finish ตาม implementation ของ ErrorCollector

ทำงานยังไง

ไม่มี body ใน source declaration นี้

Parameters

  • int i

ตัวอย่างใช้งาน

ErrorCollector instance = ...;
instance.finish(0);

net.minecraft.util.parsing.packrat.ErrorCollector#store(int,Object)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/ErrorCollector.java:9
  • Modifiers: default
  • Return: void

คืออะไร

ดำเนินการ store ตาม implementation ของ ErrorCollector

ทำงานยังไง

เรียกต่อ: empty().

Parameters

  • int i
  • Object object

ตัวอย่างใช้งาน

ErrorCollector instance = ...;
Object object = ...;
instance.store(0, object);

net.minecraft.util.parsing.packrat.ErrorCollector#store(int,SuggestionSupplier<S>,Object)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/ErrorCollector.java:7
  • Modifiers: ``
  • Return: void

คืออะไร

ดำเนินการ store ตาม implementation ของ ErrorCollector

ทำงานยังไง

ไม่มี body ใน source declaration นี้

Parameters

  • int i
  • SuggestionSupplier<S> suggestionSupplier
  • Object object

ตัวอย่างใช้งาน

ErrorCollector instance = ...;
SuggestionSupplier<S> suggestionSupplier = ...;
Object object = ...;
instance.store(0, suggestionSupplier, object);

ParseState

  • Full name: net.minecraft.util.parsing.packrat.ParseState
  • Package: net.minecraft.util.parsing.packrat
  • Source: commonnet/minecraft/util/parsing/packrat/ParseState.java
  • Type: class
  • Modifiers: public abstract

net.minecraft.util.parsing.packrat.ParseState#errorCollector()

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/ParseState.java:18
  • Modifiers: public
  • Return: ErrorCollector<S>

คืออะไร

ดำเนินการ errorCollector ตาม implementation ของ ParseState

ทำงานยังไง

คืนค่า: this.errorCollector.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

ParseState instance = ...;
ErrorCollector<S> result = instance.errorCollector();

net.minecraft.util.parsing.packrat.ParseState#input()

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/ParseState.java:58
  • Modifiers: public abstract
  • Return: S

คืออะไร

ดำเนินการ input ตาม implementation ของ ParseState

ทำงานยังไง

ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

ParseState instance = ...;
S result = instance.input();

net.minecraft.util.parsing.packrat.ParseState#mark()

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/ParseState.java:60
  • Modifiers: public abstract
  • Return: int

คืออะไร

ดำเนินการ mark ตาม implementation ของ ParseState

ทำงานยังไง

ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

ParseState instance = ...;
int result = instance.mark();

net.minecraft.util.parsing.packrat.ParseState#parse(Atom<T>)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/ParseState.java:31
  • Modifiers: public
  • Return: Optional<T>

คืออะไร

แปลง/วิเคราะห์ข้อมูล parse

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: mark(), lookupInCache(), restore(), get(), storeInCache(). สร้างออบเจ็กต์: ParseState.CacheKey<>, IllegalStateException. มีจุด return อย่างน้อย 2 จุด.

Parameters

  • Atom<T> atom

ตัวอย่างใช้งาน

ParseState instance = ...;
Atom<T> atom = ...;
Optional<T> result = instance.parse(atom);

net.minecraft.util.parsing.packrat.ParseState#ParseState(Dictionary<S>,ErrorCollector<S>)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/ParseState.java:13
  • Modifiers: protected
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ ParseState ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: dictionary, errorCollector.

Parameters

  • Dictionary<S> dictionary
  • ErrorCollector<S> errorCollector

ตัวอย่างใช้งาน

Dictionary<S> dictionary = ...;
ErrorCollector<S> errorCollector = ...;
ParseState instance = new ParseState(dictionary, errorCollector);

net.minecraft.util.parsing.packrat.ParseState#parseTopRule(Atom<T>)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/ParseState.java:22
  • Modifiers: public
  • Return: Optional<T>

คืออะไร

แปลง/วิเคราะห์ข้อมูล Top Rule

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: parse(), isPresent(), finish(), mark(). คืนค่า: optional.

Parameters

  • Atom<T> atom

ตัวอย่างใช้งาน

ParseState instance = ...;
Atom<T> atom = ...;
Optional<T> result = instance.parseTopRule(atom);

net.minecraft.util.parsing.packrat.ParseState#restore(int)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/ParseState.java:62
  • Modifiers: public abstract
  • Return: void

คืออะไร

ดำเนินการ restore ตาม implementation ของ ParseState

ทำงานยังไง

ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง

Parameters

  • int i

ตัวอย่างใช้งาน

ParseState instance = ...;
instance.restore(0);

Rule

  • Full name: net.minecraft.util.parsing.packrat.Rule
  • Package: net.minecraft.util.parsing.packrat
  • Source: commonnet/minecraft/util/parsing/packrat/Rule.java
  • Type: interface
  • Modifiers: public

net.minecraft.util.parsing.packrat.Rule#fromTerm(Term<S>,Rule.RuleAction<S, T>)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Rule.java:8
  • Modifiers: static
  • Return: Rule<S, T>

คืออะไร

ดำเนินการ fromTerm ตาม implementation ของ Rule

ทำงานยังไง

สร้างออบเจ็กต์: Rule.WrappedTerm<>. คืนค่า: new Rule.WrappedTerm<>(ruleAction, term).

Parameters

  • Term<S> term
  • Rule.RuleAction<S, T> ruleAction

ตัวอย่างใช้งาน

Term<S> term = ...;
Rule.RuleAction<S, T> ruleAction = ...;
Rule<S, T> result = Rule.fromTerm(term, ruleAction);

net.minecraft.util.parsing.packrat.Rule#fromTerm(Term<S>,Rule.SimpleRuleAction<T>)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Rule.java:12
  • Modifiers: static
  • Return: Rule<S, T>

คืออะไร

ดำเนินการ fromTerm ตาม implementation ของ Rule

ทำงานยังไง

เรียกต่อ: of(), run(). สร้างออบเจ็กต์: Rule.WrappedTerm<>. คืนค่า: new Rule.WrappedTerm<>((parseState, scope) -> Optional.of(simpleRuleAction.run(scope)), term).

Parameters

  • Term<S> term
  • Rule.SimpleRuleAction<T> simpleRuleAction

ตัวอย่างใช้งาน

Term<S> term = ...;
Rule.SimpleRuleAction<T> simpleRuleAction = ...;
Rule<S, T> result = Rule.fromTerm(term, simpleRuleAction);

net.minecraft.util.parsing.packrat.Rule#parse(ParseState<S>)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Rule.java:6
  • Modifiers: ``
  • Return: Optional<T>

คืออะไร

แปลง/วิเคราะห์ข้อมูล parse

ทำงานยังไง

ไม่มี body ใน source declaration นี้

Parameters

  • ParseState<S> parseState

ตัวอย่างใช้งาน

Rule instance = ...;
ParseState<S> parseState = ...;
Optional<T> result = instance.parse(parseState);

Scope

  • Full name: net.minecraft.util.parsing.packrat.Scope
  • Package: net.minecraft.util.parsing.packrat
  • Source: commonnet/minecraft/util/parsing/packrat/Scope.java
  • Type: class
  • Modifiers: public final

net.minecraft.util.parsing.packrat.Scope#equals(Object)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Scope.java:55
  • Modifiers: public
  • Return: boolean

คืออะไร

เปรียบเทียบความเท่ากัน equals

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. มีจุด return อย่างน้อย 2 จุด.

Parameters

  • Object object

ตัวอย่างใช้งาน

Scope instance = ...;
Object object = ...;
boolean result = instance.equals(object);

net.minecraft.util.parsing.packrat.Scope#get(Atom<T>)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Scope.java:15
  • Modifiers: public
  • Return: T

คืออะไร

อ่านค่า get

ทำงานยังไง

คืนค่า: (T)this.values.get(atom).

Parameters

  • Atom<T> atom

ตัวอย่างใช้งาน

Scope instance = ...;
Atom<T> atom = ...;
T result = instance.get(atom);

net.minecraft.util.parsing.packrat.Scope#getAny(Atom<T>[])

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Scope.java:28
  • Modifiers: public final
  • Return: T

คืออะไร

อ่านค่า Any

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: get(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • Atom<T>[] atoms

ตัวอย่างใช้งาน

Scope instance = ...;
Atom<T>[] atoms = ...;
T result = instance.getAny(atoms);

net.minecraft.util.parsing.packrat.Scope#getAnyOrThrow(Atom<T>[])

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Scope.java:41
  • Modifiers: public final
  • Return: T

คืออะไร

อ่านค่า Any Or Throw

ทำงานยังไง

เรียกต่อ: requireNonNull(), getAny(). คืนค่า: Objects.requireNonNull(this.getAny(atoms)).

Parameters

  • Atom<T>[] atoms

ตัวอย่างใช้งาน

Scope instance = ...;
Atom<T>[] atoms = ...;
T result = instance.getAnyOrThrow(atoms);

net.minecraft.util.parsing.packrat.Scope#getOrDefault(Atom<T>,T)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Scope.java:24
  • Modifiers: public
  • Return: T

คืออะไร

อ่านค่า Or Default

ทำงานยังไง

เรียกต่อ: requireNonNullElse(), get(). คืนค่า: Objects.requireNonNullElse(this.get(atom), object).

Parameters

  • Atom<T> atom
  • T object

ตัวอย่างใช้งาน

Scope instance = ...;
Atom<T> atom = ...;
T object = ...;
T result = instance.getOrDefault(atom, object);

net.minecraft.util.parsing.packrat.Scope#getOrThrow(Atom<T>)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Scope.java:20
  • Modifiers: public
  • Return: T

คืออะไร

อ่านค่า Or Throw

ทำงานยังไง

เรียกต่อ: requireNonNull(), get(). คืนค่า: Objects.requireNonNull(this.get(atom)).

Parameters

  • Atom<T> atom

ตัวอย่างใช้งาน

Scope instance = ...;
Atom<T> atom = ...;
T result = instance.getOrThrow(atom);

net.minecraft.util.parsing.packrat.Scope#hashCode()

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Scope.java:64
  • Modifiers: public
  • Return: int

คืออะไร

ดำเนินการ hashCode ตาม implementation ของ Scope

ทำงานยังไง

คืนค่า: this.values.hashCode().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Scope instance = ...;
int result = instance.hashCode();

net.minecraft.util.parsing.packrat.Scope#put(Atom<T>,T)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Scope.java:11
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ put ตาม implementation ของ Scope

ทำงานยังไง

ทำงานตาม body โดยตรง (ประมาณ 1 statement).

Parameters

  • Atom<T> atom
  • T object

ตัวอย่างใช้งาน

Scope instance = ...;
Atom<T> atom = ...;
T object = ...;
instance.put(atom, object);

net.minecraft.util.parsing.packrat.Scope#putAll(Scope)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Scope.java:51
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ putAll ตาม implementation ของ Scope

ทำงานยังไง

ทำงานตาม body โดยตรง (ประมาณ 1 statement).

Parameters

  • Scope scope

ตัวอย่างใช้งาน

Scope instance = ...;
Scope scope = ...;
instance.putAll(scope);

net.minecraft.util.parsing.packrat.Scope#toString()

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Scope.java:46
  • Modifiers: public
  • Return: String

คืออะไร

ดำเนินการ toString ตาม implementation ของ Scope

ทำงานยังไง

คืนค่า: this.values.toString().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Scope instance = ...;
String result = instance.toString();

SuggestionSupplier

  • Full name: net.minecraft.util.parsing.packrat.SuggestionSupplier
  • Package: net.minecraft.util.parsing.packrat
  • Source: commonnet/minecraft/util/parsing/packrat/SuggestionSupplier.java
  • Type: interface
  • Modifiers: public

net.minecraft.util.parsing.packrat.SuggestionSupplier#empty()

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/SuggestionSupplier.java:8
  • Modifiers: static
  • Return: SuggestionSupplier<S>

คืออะไร

ดำเนินการ empty ตาม implementation ของ SuggestionSupplier

ทำงานยังไง

คืนค่า: parseState -> Stream.empty().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

SuggestionSupplier<S> result = SuggestionSupplier.empty();

net.minecraft.util.parsing.packrat.SuggestionSupplier#possibleValues(ParseState<S>)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/SuggestionSupplier.java:6
  • Modifiers: ``
  • Return: Stream<String>

คืออะไร

ดำเนินการ possibleValues ตาม implementation ของ SuggestionSupplier

ทำงานยังไง

ไม่มี body ใน source declaration นี้

Parameters

  • ParseState<S> parseState

ตัวอย่างใช้งาน

SuggestionSupplier instance = ...;
ParseState<S> parseState = ...;
Stream<String> result = instance.possibleValues(parseState);

Term

  • Full name: net.minecraft.util.parsing.packrat.Term
  • Package: net.minecraft.util.parsing.packrat
  • Source: commonnet/minecraft/util/parsing/packrat/Term.java
  • Type: interface
  • Modifiers: public

net.minecraft.util.parsing.packrat.Term#alternative(Term<S>[])

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Term.java:23
  • Modifiers: static
  • Return: Term<S>

คืออะไร

ดำเนินการ alternative ตาม implementation ของ Term

ทำงานยังไง

เรียกต่อ: of(). สร้างออบเจ็กต์: Term.Alternative<>. คืนค่า: new Term.Alternative<>(List.of(terms)).

Parameters

  • Term<S>[] terms

ตัวอย่างใช้งาน

Term<S>[] terms = ...;
Term<S> result = Term.alternative(terms);

net.minecraft.util.parsing.packrat.Term#cut()

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Term.java:32
  • Modifiers: static
  • Return: Term<S>

คืออะไร

ดำเนินการ cut ตาม implementation ของ Term

ทำงานยังไง

เรียกต่อ: parse(), toString(). สร้างออบเจ็กต์: Term<S>. มีจุด return อย่างน้อย 3 จุด.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Term<S> result = Term.cut();

net.minecraft.util.parsing.packrat.Term#empty()

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Term.java:47
  • Modifiers: static
  • Return: Term<S>

คืออะไร

ดำเนินการ empty ตาม implementation ของ Term

ทำงานยังไง

เรียกต่อ: parse(), toString(). สร้างออบเจ็กต์: Term<S>. มีจุด return อย่างน้อย 2 จุด.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Term<S> result = Term.empty();

net.minecraft.util.parsing.packrat.Term#marker(Atom<T>,T)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Term.java:14
  • Modifiers: static
  • Return: Term<S>

คืออะไร

ดำเนินการ marker ตาม implementation ของ Term

ทำงานยังไง

สร้างออบเจ็กต์: Term.Marker<>. คืนค่า: new Term.Marker<>(atom, object).

Parameters

  • Atom<T> atom
  • T object

ตัวอย่างใช้งาน

Atom<T> atom = ...;
T object = ...;
Term<S> result = Term.marker(atom, object);

net.minecraft.util.parsing.packrat.Term#named(Atom<?>)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Term.java:10
  • Modifiers: static
  • Return: Term<S>

คืออะไร

ดำเนินการ named ตาม implementation ของ Term

ทำงานยังไง

สร้างออบเจ็กต์: Term.Reference<>. คืนค่า: new Term.Reference<>(atom).

Parameters

  • Atom<?> atom

ตัวอย่างใช้งาน

Atom<?> atom = ...;
Term<S> result = Term.named(atom);

net.minecraft.util.parsing.packrat.Term#optional(Term<S>)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Term.java:28
  • Modifiers: static
  • Return: Term<S>

คืออะไร

ดำเนินการ optional ตาม implementation ของ Term

ทำงานยังไง

สร้างออบเจ็กต์: Term.Maybe<>. คืนค่า: new Term.Maybe<>(term).

Parameters

  • Term<S> term

ตัวอย่างใช้งาน

Term<S> term = ...;
Term<S> result = Term.optional(term);

net.minecraft.util.parsing.packrat.Term#parse(ParseState<S>,Scope,Control)

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Term.java:8
  • Modifiers: ``
  • Return: boolean

คืออะไร

แปลง/วิเคราะห์ข้อมูล parse

ทำงานยังไง

ไม่มี body ใน source declaration นี้

Parameters

  • ParseState<S> parseState
  • Scope scope
  • Control control

ตัวอย่างใช้งาน

Term instance = ...;
ParseState<S> parseState = ...;
Scope scope = ...;
Control control = ...;
boolean result = instance.parse(parseState, scope, control);

net.minecraft.util.parsing.packrat.Term#sequence(Term<S>[])

  • Origin: common
  • Source: net/minecraft/util/parsing/packrat/Term.java:18
  • Modifiers: static
  • Return: Term<S>

คืออะไร

ดำเนินการ sequence ตาม implementation ของ Term

ทำงานยังไง

เรียกต่อ: of(). สร้างออบเจ็กต์: Term.Sequence<>. คืนค่า: new Term.Sequence<>(List.of(terms)).

Parameters

  • Term<S>[] terms

ตัวอย่างใช้งาน

Term<S>[] terms = ...;
Term<S> result = Term.sequence(terms);