File: class_info.e

package info (click to toggle)
eglade 0.3.2-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 560 kB
  • ctags: 823
  • sloc: yacc: 429; makefile: 174; sh: 24; ansic: 9
file content (45 lines) | stat: -rw-r--r-- 887 bytes parent folder | download
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
39
40
41
42
43
44
45
-- Copyright (C) 1999 Daniel Elphick and others
-- Licensed under Eiffel Forum Freeware License, version 1;
-- (see forum.txt)
--
indexing

	description: ""
	author: "Daniel Elphick <de397@ecs.soton.ac.uk>"

class CLASS_INFO

creation

	make

feature

	widget_tree: TAG_TREE

	name:STRING
	class_name:STRING
	
	make(tree: TAG_TREE) is
		require
			non_void_tree: tree /= Void
			is_widget: tree.tag.is_equal("widget")
		do
			widget_tree := tree
			class_name := tree.get_string_from_field("class")
			if class_name.is_equal("") then
				print("A widget must have a class%N")
				die_with_code(exit_failure_code)
			end
			if not class_name.is_equal("Placeholder") then
				name := tree.get_string_from_field("name")
				if name.is_equal("") then
					print("A widget must have a name%N")
					die_with_code(exit_failure_code)
				end
			else
				name := "Placeholder"
			end
		end

end