Chemical species and chemical reaction rules
For the implementation of the oxycat use case (https://git.scc.kit.edu/virtmat-tools/virtmat-models-and-data-analyses/-/issues/6) it will be helpful to create a small thermochemistry language. Here a suggestion for grammar:
ChemTerm:
(coefficient = NUMBER)*
species = [Species:ID]
;
ChemReaction: // add rule to Parameter
'Reaction'
educts += ChemTerm['+'] ( '=' | '->' )
products += ChemTerm['+']
(
('enthalpy' enthalpy = NumericalScalarParameter)?
('entropy' entropy = NumericalScalarParameter)?
('free energy' free_energy = NumericalScalarParameter)?
)#
;
ChemSpecies: // add rule to Statement
'Species'
name = ID (
('enthalpy' enthalpy = NumericalScalarParameter)?
('entropy' entropy = NumericalScalarParameter)?
('free energy' free_energy = NumericalScalarParameter)?
('structure' structure = VarReference)?
)#
;
Edited by Ivan Kondov