summaryrefslogtreecommitdiff
path: root/cad/plugins/NanoVision-1/src/Plugins/NanorexMMPImportExport/molecule.rl
blob: 8999abe915a8cf298294bdcf2185faf33173a314 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// molecule.rl - Copyright 2008 Nanorex, Inc.  See LICENSE file for details.

%%{
# Ragel: definitions to recognize a molecule statement
	
	machine molecule;
	
	mol_decl_line = WHITESPACE**
		'mol'  >{lineStart=p;}
		nonNEWLINEspace+
			>to { stringVal2.clear(); /* 'style' string optional */ }
		'('  nonNEWLINEspace*  char_string_with_space  nonNEWLINEspace* ')'
		(nonNEWLINEspace+ char_string_with_space2)?
		nonNEWLINEspace*
		EOL
		@ {
			if(stringVal2 == "")
				stringVal2 = "def";
			newMolecule(stringVal, stringVal2);
		}
		;
	
	info_chunk_line =
		'info'   >{lineStart=p;}
		nonNEWLINEspace+
		'chunk'
		nonNEWLINEspace+
		char_string_with_space
		nonNEWLINEspace*
		'='
		nonNEWLINEspace*
		char_string_with_space2
		nonNEWLINEspace*
		EOL
		@ { newChunkInfo(stringVal, stringVal2); }
		;

}%%